1. Conceptually, there is no string data type in the C language
2. Using character arrays in the C language to simulate strings
The string in the 3.C language is an array of characters ending with '% '
Strings in the 4.C language can be allocated to stack space, heap space, or read-only storage
5. The length of the string is the number of characters contained in the string
The length of the string in the 6.C language refers to the number of characters that appear before the first ' + ' character
The length of the string is determined in the 7.C language by the '% ' Terminator
Attention:
The number of strlen returned is unsigned, and the two unsigned number subtraction remains an unsigned number.
1. In general, do not write your own C label library has been provided by the function
2. The standard library is sometimes implemented in assembly language in order to make full use of the special instructions provided by the machine in pursuit of maximum speed.
3. Reusing an existing library of functions is more efficient.
4. An unrestricted string function is to determine the length by looking for the string "Terminator"
5.strncpy and Strncat must ensure that the remaining space in the target character array is sufficient to hold the entire source string.
6.STRCMP with a value of 0 means two strings equal, the first string is greater than the second string when the return value is greater than 0, the first string is less than the second string when the return value is less than 0
The 7.STRCNMP does not modify the parameter values, but still takes '% ' as the Terminator.
8. Length-constrained string function receives a displayed length parameter to limit the number of characters in the operation
9.strncpy copies only Len characters to the target string, and when the source string is less than Len, the remaining space is filled with ' \ s ', and when the source string is longer than Len, only Len characters are copied, and he will not end with '. '
10.strncat copy len characters from the source string up to the target string, strncat always adds '% ' after the end string, and Strncat does not fill the remaining space in the target string with '/'.
11.STRNCMP compares only Len characters for equality.
Strings in the C language