C Programming
Pre-defined function
The function which is provided by the system is called pre-defined function. We can use the pre-defined function but cannot change it or re-define it.
List of pre-defined C functions in string.h file:
https://chandrabhushank.blogspot.in
String functions
|
Description
|
strcat() | Concatenates string str2 at the end of string str1 |
exit() | This function terminates the program and does not return any value |
strcpy ( ) | Copies string str2 into string str1 |
strncpy ( ) | Copies given number of characters of one string to another |
strlen ( ) | Gives the length of string str1 |
strcmp ( ) | Returns 0 if str1 is same as str2. Returns <0 eturns="" if="" nbsp="" str2.="" strl="">0 if str1 > str20> |
strcmpi ( ) | Same as strcmp() function. But, this function negotiates case. “A” and “a” are treated as same. |
strchr ( ) | Returns pointer to first occurrence of char in str1 |
strrchr ( ) | last occurrence of given character in a string is found |
strstr ( ) | Returns pointer to first occurrence of str2 in str1 |
strrstr ( ) | Returns pointer to last occurrence of str2 in str1 |
strdup ( ) | Duplicates the string |
strlwr ( ) | Converts string to lowercase |
strupr ( ) | Converts string to uppercase |
strrev ( ) | Reverses the given string |
strset ( ) | Sets all character in a string to given character |
strnset ( ) | It sets the portion of characters in a string to given character |
strtok ( ) | Tokenizing given string using delimiter |
String functions
|
Description
|
memset() | It is used to initialize a specified number of bytes to null or any other value in the buffer |
memcpy() | It is used to copy a specified number of bytes from one memory to another |
memmove() | It is used to copy a specified number of bytes from one memory to another or to overlap on same memory. |
memcmp() | It is used to compare specified number of characters from two buffers |
memicmp() | It is used to compare specified number of characters from two buffers regardless of the case of the characters |
memchr() | It is used to locate the first occurrence of the character in the specified string |