#include
A commonly used header file in the C language standard library, which is needed when using character arrays. The string .h header file defines a variable type, a macro and various functions for operating character arrays.
string.h is widely used in both c language and c language, but the specific situations are not the same. Since traditional C was born out of C, the usage of this term in traditional C is similar to that in C language. In standard C, which has been modified and standardized by the American Standardization Organization, the definition is quite different.
Includes commonly used functions as follows:
strlen finds the length of a string
strcmp compares two strings to see if they are the same
strcat string connection operation
strcpy string copy operation
strncat string connection operation (first n characters)
strncpy string copy operation (first n characters)
strchr query String
strstr Query substring
Examples:
For example, strcat() string link function; strcpy() string copy function, etc.
Take the strcpy function as an example to implement its call:
#include <stdio.h> #include"string.h" int main() { char a[50]="asd",b[10]="aaa"; strcpy(a,b); printf("%s\n",a); }
The above is the detailed content of What does include