Character and

String
1.char a[5]={'a','b','v','c','w'}
2.char a[]={'a','b','v' ,'c','w','/0'}
3.char a[]={"finish"}
4.char name[5];
name[0]='a';
5.char name[may not Write length]="character string" cahr name[]={'character 1',...,'character n','\0'}; the
second type must end with'\0; the
first type can be Chinese, The second type cannot write Chinese. When outputting characters, you can use printf or puts (character array name);
6.strlen('character') gets the length of the character;
strcmp() compares the ASCII code value, the same is 0, s1>s2 is 1 , S1<s2 is -1;
strcpy(s1,s2) copies s2 to s1 and overwrites;
strcat(s1,s2) parallels s2 to s1, but the character length of s1 must be greater than the combined length of the two; Connection
7. strcpy (str1, str2, 5) 5 is the length that restricts 1 to enter 2, str1[5]='\0';

Guess you like

Origin blog.csdn.net/LiAiZu/article/details/83687129