All C inbuilt functions which are
declared in string.h header file are given below. The source code for
string.h header file is also given below for your reference.
List of inbuilt C functions in string.h file:
S.no |
string functions
|
Description
|
1 | strcat(str1, str2) | Concatenates str2 at the end of str1. |
2 | strcpy(str1, str2) | Copies str2 into str1 |
3 | strlen(strl) | gives the length of str1. |
4 | strcmp(str1, str2) | Returns 0 if str1 is same as str2. Returns <0 if strl < str2. Returns >0 if str1 > str2. |
5 | strchr(str1,char) | Returns pointer to first occurrence of char in str1. |
6 | strstr(str1, str2) | Returns pointer to first occurrence of str2 in str1. |
7 | strcmpi(str1,str2) | Same as strcmp() function. But, this function negotiates case. “A” and “a” are treated as same. |
8 | strdup() | duplicates the string |
9 | strlwr() | converts string to lowercase |
10 | strncat() | appends a portion of string to another |
11 | strncpy() | copies given number of characters of one string to another |
12 | strrchr() | last occurrence of given character in a string is found |
13 | strrev() | reverses the given string |
14 | strset() | sets all character in a string to given character |
15 | strupr() | converts string to uppercase |
16 | strtok() | tokenizing given string using delimiter |
17 | memset() | It is used to initialize a specified number of bytes to null or any other value in the buffer |
18 | memcpy() | It is used to copy a specified number of bytes from one memory to another |
19 | memmove() | It is used to copy a specified number of bytes from one memory to another or to overlap on same memory. |
20 | memcmp() | It is used to compare specified number of characters from two buffers |
21 | memicmp() | It is used to compare specified number of characters from two buffers regardless of the case of the characters |
22 | memchr() | It is used to locate the first occurrence of the character in the specified string |
0 comments:
Post a Comment