数组名称是常指针

记下以后所有碰到使用数组名称时候的是是非非:

int main(int argc, char* argv[])
{
    char x[3]="abc"; // 编译错误
    char a[3]={'a','b','c'};
    char b[3];
    b=a; // 常指针不能赋值
    return 0;
}

 

posted @ 2014-05-23 03:37  findumars  Views(378)  Comments(0Edit  收藏  举报