C Strings

strcpy() function

Instead use the strcpy(0 function found in most compilers the syntax of the function is illustrated below.
strcpy(string1,string2);

Strcpy function assigns the contents of string2 to string1. string2 may be a character array variable or a string constant.
strcpy(Name,”Robert”);

In the above example Robert is assigned to the string called name.

strlwr () function

This function converts all characters in a string from uppercase to lowercase.
syntax 
		strlwr(string); 
For example: 
		strlwr(“EXFORSYS”) converts to Exforsys. 
        


strrev() function

This function reverses the characters in a string.
Syntax 
		strrev(string); 
For ex 
		strrev(“program”) 
reverses the characters in a string into “margrop”.

strupr() function

This function converts all characters in a string from lower case to uppercase.
Syntax 
		strupr(string); 
For example 
		strupr(“exforsys”) 
will convert the string to EXFORSYS.

Make Comments..!!


Oops!! No posts from user.

Download Android App