编译错误系列------对字符数组赋值

来源:互联网 发布:广义线性模型 知乎 编辑:程序博客网 时间:2024/06/06 20:41

一开始我下意识的直接赋值

 char buf[SIZE];

error: incompatible types in assignment of 'const char [5]' to 'char [128]'
    buf="full" ;

后来才知道必须strcpy(buf,"Full");

buf是个数组是个const char *常量,不能够修改其值,执行赋值操作是非法的

0 0