程序中那个地方错了?#include "stdafx.h"#includeusing namespace std;int _tmain(int argc,_TCHAR* argv[]){ char word[4];word[4]={'a','b','c'};return 0;}
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 21:36:06
程序中那个地方错了?#include "stdafx.h"#includeusing namespace std;int _tmain(int argc,_TCHAR* argv[]){ char word[4];word[4]={'a','b','c'};return 0;}
程序中那个地方错了?
#include "stdafx.h"
#include
using namespace std;
int _tmain(int argc,_TCHAR* argv[])
{ char word[4];
word[4]={'a','b','c'};
return 0;
}
程序中那个地方错了?#include "stdafx.h"#includeusing namespace std;int _tmain(int argc,_TCHAR* argv[]){ char word[4];word[4]={'a','b','c'};return 0;}
char word[4];
word[4]={'a','b','c'};
应该是char word[4] = {'a','b','c'};不可以分开
若先声明char word[4];然后再初始化各元素的值,只能依次赋值,如下
word[0] = 'a';
word[1] = 'b';
word[2] = 'c';