字符串and数组:char ch[5]={'h','e','l','l','o'};//定义初始化一个数组,长度为5 char ch[5]="hello";//长度为6,字符串在有效的字符后面加'\0',作为结束标志。 注意!!!char *p="helloworld";//字符串常量存于只读数据段,不可修改 char str[]="hello";等价于 char *p="hello";char str[6]; strcpy(str,p); 限定修饰符const:该关键字所修饰的变量是不可改变的。 const int *p //指针指向的内容不能改变 int const *p;//同上 int* const p //指针本身不可改变,永远指向这一块内存单元 int const * const p //指针本身不能变,并且指向的内容也不能变。