标签:
char a[] = "hello"; a[0] = ‘x‘; char *p = "world"; //指向常量字符串 p[0] = ‘x‘; //编译无错,运行出错
char a[] = "hello"; char *p = a; cout << sizeof(a) << endl; //6 cout << sizeof(p) << endl; //4 void func(char a[100]){ cout << sizeof(a) << endl; //4 }
标签:
原文地址:http://www.cnblogs.com/yingl/p/5817326.html