且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个单位一个字符串的第一个字节

更新时间:2022-03-13 16:58:41

您不能修改字符串常量,将其更改为:

You can't modify a string literal, change it to:

char str[] = "hello";   //not string literal
printf("%s\n", str);
str[0]++;              //add 1 to the first element
printf("%s\n", str);