string.h library functions

All C inbuilt functions which are declared in string.h header file are given below.

LIST OF INBUILT C FUNCTIONS IN STRING.H FILE:

String functions
Description
strcat ( ) Concatenates str2 at the end of str1
strncat ( ) Appends a portion of string to another
strcpy ( ) Copies str2 into str1
strncpy ( ) Copies given number of characters of one string to another
strlen ( ) Gives the length of str1
strcmp ( ) Returns 0 if str1 is same as str2. Returns 0 if str1 > str2
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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s