程序中那个地方错了?#include "stdafx.h"#includeusing namespace std;int _tmain(int argc,_TCHAR* argv[]){ char word[4];word[4]={'a','b','c'};return 0;}
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 17:30:44
程序中那个地方错了?#include"stdafx.h"#includeusingnamespacestd;int_tmain(intargc,_TCHAR*argv[]){charword[4];w
程序中那个地方错了?#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';