error C2440: “=”: 无法从“const char [2]”转换为“char”
//112,5.10.6.cpp:定义控制台应用程序的入口点。//#include"stdafx.h"#include<stdio.h>int_tmain(intargc...
// 112,5.10.6.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
char c1, c2;
int diff;
float num;
c1 = "S";
c2 = "O";
diff = c1 - c2;
num = diff;
printf("%c%c%c: %d %3.2f\n", c1, c2, c1, diff, num);
return 0;
} 展开
//
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
char c1, c2;
int diff;
float num;
c1 = "S";
c2 = "O";
diff = c1 - c2;
num = diff;
printf("%c%c%c: %d %3.2f\n", c1, c2, c1, diff, num);
return 0;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询