Explain any four standard library functions from string.h

Subject : Structured Programming Approach

Title : Fundamentals Of C-Programming

Marks : 4M

1 Answer

Standard Library Functions from string.h:

In the C Programming Language, the Standard Library Functions are divided into several header files.

The following is a list of functions found within the <string.h> header file:

I.Comparison functions:

1.memcmp -Compare Memory Blocks

2.strcmp -String Compare

3.strcoll -String Compare Using Locale-Specific Collating sequence.

4.strncmp -Bounded String Compare

5.strxfrm -Transform Locale-Specific String

II.Concatenation functions:

1.strcat -String Concatenation

2.strncat -Bounded String Concatenation

III.Copying functions:

1.memcpy-Copy Memory Block

2.memmove -Copy Memory Block

3.strcpy-String Copy

4.strncpy-Bounded String Copy

IV.Search functions:

1.memchr-Search Memory Block for Character

2.strchr -Search String for Character

3.strcspn -Search String for Intial Span of Characters Not in Set

4.strpbrk -Search String for One of a Set of Characters

5.strrchr -Search String in Reverse for Character

6.strspn -Search String for Initial Span of Characters in Set

7.strstr -Search String for Substring

8.strtok -Search String for Token

V.Miscellaneous functions:

1.memset -Initialize Memory Block

2.strerror -Convert Error Number to String

3.strlen -String Length

Please log in to add an answer.

Continue reading...

The best way to discover useful content is by searching it.