C tutorial - String and String functions in c programming language & header file in c

Programming languages or concepts

 String and String functions in c programming language & <string.h> header file in c


String.h is the header file in the C standard library for C programming language which contains micro definition, constant & declaration of function and types using not only for string handling but also variable memory handling function.

   Function declared in string.h are externally popular.

    it is also c standard library function.

   String functions only works with characters encoding made of types such as ASCII & UTF-8.

   String.h header defines one variable type, and variable function for manipulate in array of characters.


Following is <String.h> reader function and description:


Variable and description

Size_t:- This is the unsigned integral type and is the result of the sizeof keyword.


Library micro and description-

  Null:-.  This micro is the value of a null pointer constant.



  • The"mem" functions manipulate sequence of arbitrary characters without regard to the null character.
  • The "Str" function manipulate null_terminated sequence character.
  • The "Strn" functions manipulates occurrence of non_null characters.

Following is a commonly used string function:-

    Some of the most commonly used functions in the string library are:-


  1. Strcat:- concatenate two string.
  2. Strchr:- string scanning operation.
  3. Strcmp:- compare two string.
  4. Strcpy:- copy a string.
  5. Strlen :- get string length.
  6. Strncat:- concatenate one string with part of another.
  7. Strncmp :- compare a part of two strings.
  8. Strncpy:- copy part of a string.
  9. Strrchr:- string scanning operation.
  10. Strlwr:- convert to lowercase.
  11. Strrev:- return the string reversed.
  12. Strupr:- convert to uppercase.

This is a some function for more details of <functionString.h> function and description click here

close