#include<iostream.h> #include<alloc.h> int main(){ char* const pc ="asdf"; //pc ="dfgh"; error: assignment of read-only variable `pc‘ *pc =‘b‘; *(pc+1)=‘c‘; //*pc ++ =‘y‘; error: increment of read-only variable `pc‘ const int b =28; //int *const pi =&b; error: invalid conversion from `const int*‘ to `int*‘ }
被这个代码搞蒙了,然后我就看到了这篇文章
http://www.360doc.com/content/12/1013/09/2472295_241178117.shtml
时间: 2024-11-05 23:28:40