字符串的东西好杂,感觉每次用到的时候都在查,就记录一下叭
char数组,和数组一样,不能重复赋值,但可以改变单个位置上的值
如果你这样初始化char myword[] = "hello";
编译器会自动在结尾补上'\0'
char数组和string的不同之处在于:数组的大小会在声明的时候确定【不管是像上面那样,还是char s[20];
】但是string的大小是在程序运行的时候确定的
Strings have a dynamic size determined during runtime, while the size of arrays is determined on compilation, before the program runs.