answersLogoWhite

0

What is string.h?

Updated: 8/10/2023
User Avatar

Wiki User

14y ago

Best Answer

With the string.h header file you can do special string functions such as

----

strcat() Sticks two strings together, one at the end of another.

strncat() Sticks a given amount of characters from two strings together, one at the end of another.

strchr() Returns the location of a character in a string from the beginning.

strrchr() Returns the location of a character in a string from the end.

strcmp() Compares 2 strings and returns the value 0 if both match.

strcasecmp() Compares 2 strings ignoring case and returns the value 0 if both match.

strncasecmp() Compares only a set number of characters in 2 strings ignoring case.

strcpy() Copies one string into another.

strncpy() Copies only a set number of characters from one string to another.

strlen() Returns the length of the string (Except the final NULL character).

The null character is \0 which dignifies the end of a string.

strstr() Locates one string inside of another.

Remember to use these you MUST include the string.h header file by typing #include <string.h>.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

One of the standard headers.

Contains prototypes for functions like strcpy, strcmp, memmove.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is string.h?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions