C语言中的字符串

c语言中的字符串可以理解为是一个由多个字符(char)组成的字符数组

include int main() { //字符 char c = 'A'; //字符串 char name[] = {'m','a','c','z','h','i','\0'} char name[] = "maczhi"; for(int i = 0;i < sizeof(name);i++){ printf("%c\n",name[i]); } return 0; }

Hibbs

0