English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The following are the variable types defined in the header file string.h:
Serial number | Variable & description |
---|---|
1 | size_t This is an unsigned integer type, which is sizeof The result of the keyword. |
The following are the macros defined in the header file string.h:
Serial number | Macro & description |
---|---|
1 | NULL This macro is the value of a null pointer constant. |
The following are the functions defined in the header file string.h:
Serial number | function & description |
---|---|
1 | void *memchr(const void *str, int c, size_t n) in the parameter str to search for the first occurrence of the character c (an unsigned character) in the first n bytes of the string pointed to by |
2 | int memcmp(const void *str1, const void *str2, size_t n) Copy str1 and str2 to compare the first n bytes. |
3 | void *memcpy(void *dest, const void *src, size_t n) Copy n characters from dest. |
4 | void *memmove(void *dest, const void *src, size_t n) another one used for src Copy n characters to dest function. |
5 | void *memset(void *str, int c, size_t n) Copy the character c (an unsigned character) to the parameter str 所指向的字符串的前 n 个字符。 |
6 | char *to the first n characters of the string pointed to by. *dest, const char *src) Copy src strncat(char dest strcat(char |
7 | char *to the end of the string pointed to by. *dest, const char *src, size_t n) Copy src strncat(char dest to append the string pointed to by |
8 | char *to the end of the string pointed to by, up to n characters in length. *str, int c) in the parameter str strchr(const char |
9 | to search for the first occurrence of the character c (an unsigned character) in the string pointed to by. *str1, const char *str2) Copy str1 int strcmp(const char str2 to compare the string pointed to by. |
10 | int strncmp(const char *str1, const char *str2, size_t n) Copy str1 and str2 to compare, up to the first n bytes. |
11 | int strcoll(const char *str1, const char *str2) Copy str1 and str2 to compare, the result depends on the position setting of LC_COLLATE. |
12 | char *strcpy(char *dest, const char *src) Copy src to the string pointed to by dest. |
13 | char *strncpy(char *dest, const char *src, size_t n) Copy src to the string pointed to by destand copy up to n characters. |
14 | size_t strcspn(const char *str1, const char *str2) to search the string str1 How many consecutive characters at the beginning of the string do not contain the string str2 in the string. |
15 | char *strerror(int errnum) to search for the error number errnum from the internal array and return a pointer to the error message string. |
16 | size_t strlen(const char *str) to calculate the length of the string str until the null terminator, but not including the null terminator. |
17 | char *strpbrk(const char *str1, const char *str2) to search a string str1 to find the first matching string str2 The character of the character in the string, not including the null terminator. That is, to check the string str1 The character in the string str2 Also includes when the character to be checked is in the string str |
18 | char *strrchr(const char *str, int c) in the parameter str to search for the last occurrence of the character c (an unsigned character) in the string pointed to by str. |
19 | size_t strspn(const char *str1, const char *str2) to search a string str1 The first character that is not in a string str2 to get the character index of the first occurrence of a character. |
20 | char *strstr(const char *haystack, const char *needle) in a string haystack to find the first occurrence of a string needleat the position (not including the null terminator). |
21 | char *strtok(char *str, const char *delim) to split a string str It is a set of strings,delim 为分隔符。 |
22 | size_t strxfrm(char *dest, const char *src, size_t n) 根据程序当前的区域选项中的 LC_COLLATE 来转换字符串 src 的前 n 个字符,并把它们放置在字符串 dest 中。 |