我定义了字符串char a[3];
a="135";
为什么编译不过啊,提示
Description Resource Path Location Type
#515 a value of type "char *" cannot be assigned to an entity of type "char" wmw.c /hua_evmc6678l/src line 658 C/C++ Problem
怎么才能对字符串数组的某一位赋值呢?
noaming:
字符串赋值,用下面的试试:
……
char s[30];
strcpy(s, "Good News!"); /*给数组赋字符串*/
……
对数组中字符逐个赋值char a[5]={'h','e','l','l','o'};