c语言错误 结构体 错误 1 error C2440: “初始化”: 无法从“const char [4]”转换为“char”
#include"stdafx.h"structgood{intnum;charnam;charsex;};int_tmain(intargc,_TCHAR*argv[]...
#include "stdafx.h"
struct good
{
int num;
char nam;
char sex;
};
int _tmain(int argc, _TCHAR* argv[])
{
struct good n1={1001,"sfz",'b'};
printf("n1=%d,%s,%c",n1.num,n1.nam,n1.sex);
return 0;
} 展开
struct good
{
int num;
char nam;
char sex;
};
int _tmain(int argc, _TCHAR* argv[])
{
struct good n1={1001,"sfz",'b'};
printf("n1=%d,%s,%c",n1.num,n1.nam,n1.sex);
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询