- C Library - <time.h>
- C Library - <string.h>
- C Library - <stdlib.h>
- C Library - <stdio.h>
- C Library - <stddef.h>
- C Library - <stdarg.h>
- C Library - <signal.h>
- C Library - <setjmp.h>
- C Library - <math.h>
- C Library - <locale.h>
- C Library - <limits.h>
- C Library - <float.h>
- C Library - <errno.h>
- C Library - <ctype.h>
- C Library - <assert.h>
- C Library - Home
C Standard Library Resources
C Programming Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
C Library - <string.h>
The string.h header defines one variable type, one macro, and various functions for manipulating arrays of characters.
Library Variables
Following is the variable type defined in the header string.h −
Sr.No. | Variable & Description |
---|---|
1 |
size_t This is the unsigned integral type and is the result of the sizeof keyword. |
Library Macros
Following is the macro defined in the header string.h −
Sr.No. | Macro & Description |
---|---|
1 |
NULL This macro is the value of a null pointer constant. |
Library Functions
Following are the functions defined in the header string.h −
Sr.No. | Function & Description |
---|---|
1 |
Searches for the first occurrence of the character c (an unsigned char) in the first n bytes of the string pointed to, by the argument str. |
2 |
Compares the first n bytes of str1 and str2. |
3 |
Copies n characters from src to dest. |
4 |
Another function to copy n characters from str2 to str1. |
5 |
Copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str. |
6 |
Appends the string pointed to, by src to the end of the string pointed to by dest. |
7 |
Appends the string pointed to, by src to the end of the string pointed to, by dest up to n characters long. |
8 |
Searches for the first occurrence of the character c (an unsigned char) in the string pointed to, by the argument str. |
9 |
Compares the string pointed to, by str1 to the string pointed to by str2. |
10 |
Compares at most the first n bytes of str1 and str2. |
11 |
Compares string str1 to str2. The result is dependent on the LC_COLLATE setting of the location. |
12 |
Copies the string pointed to, by src to dest. |
13 |
Copies up to n characters from the string pointed to, by src to dest. |
14 |
Calculates the length of the initial segment of str1 which consists entirely of characters not in str2. |
15 |
Searches an internal array for the error number errnum and returns a pointer to an error message string. |
16 |
Computes the length of the string str up to but not including the terminating null character. |
17 |
Finds the first character in the string str1 that matches any character specified in str2. |
18 |
Searches for the last occurrence of the character c (an unsigned char) in the string pointed to by the argument str. |
19 |
Calculates the length of the initial segment of str1 which consists entirely of characters in str2. |
20 |
Finds the first occurrence of the entire string needle (not including the terminating null character) which appears in the string haystack. |
21 |
Breaks string str into a series of tokens separated by depm. |
22 |
Transforms the first n characters of the string src into current locale and places them in the string dest. |