string.h Header File in C Programming

‘string.h’ is a header file which includes the declarations, functions, constants of string handling utilities.

These string functions are widely used today by many programmers to deal with string operations.

Some of the standard member functions of string.h header files are,

_______________________________________________________
Function Name	Description
_______________________________________________________
strlen -	Returns the length of a string.
strlwr -	Returns upper case letter to lower case.
strupr -	Returns lower case letter to upper case.
strcat -	Concatenates two strings.
strcmp -	Compares two strings.
strrev -	Reverses string.
strcpy -	Copies a string from source to destination.
_______________________________________________________

Program :

/*  Program to demonstrate string.h header file working.
Creation Date : 06 Nov 2010 08:10:13 PM
Author : www.technoexam.com [Technowell, Sangli] */

#include <stdio.h>
#include <conio.h>
#include <string.h>

int main(void)
{
	char str[50];
	clrscr();
	printf("\n\t Enter your name : ");
	gets(str);
	printf("\nLower case of string: %s",strlwr(str));
	printf("\nUpper case of string: %s",strupr(str));
	printf("\nReverse of string: %s",strrev(str));
	printf("\nLength of String: %d",strlen(str));
	getch();
	return 0;
}

Output :

	Enter your name : Technoexam
Lower case of string: technoexam
Upper case of string: TECHNOEXAM
Reverse of string: MAXEONHCET	
Length of String: 10_

Leave A Comment

Your email address will not be published. Required fields are marked *