Home > Common Problem > What does include mean?

What does include mean?

Release: 2019-07-20 17:27:44
Original
48709 people have browsed it

What does include<string.h> mean?

#include represents the header file containing string processing functions, which is a preprocessing command in C language.

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);
}
Copy after login

What does include<string.h> mean?

The above is the detailed content of What does include mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template