true otherwise . General Form: isupper(char c) For the following examples value will be assigned to n and for m. int n=isupper(‘A’); int m=isupper(‘a’); . .
. . toupper() This function is used to convert the given character into its uppercase. This function will return the upper case equivalent of the given character.
If the given character itself is in upper case, the output will be the same. General Form: char toupper(char c); The following statement will assign the character constant 'K' to the variable c. char c = toupper('k’); But, the output of the statement given below will be 'B' itself. cout <<toupper('B'); .
. . . tolower() This function is used to convert the given character into its lowercase.
This function will return the lower case equivalent of the given character. If the given character itself is in lower case, the output will be the same. General Form: char tolower(char c) The following statement will assign the character constant ' k' to the variable c. char c = tolower('K’); But, the output of the statement given below will be 'b' itself.
cout <<tolower('b'); . . String manipulation (string.h) The library string.h (also referred as cstring) has several common functions for dealing with strings stored in array of characters. The string.h header file is to be included before using any string function.
Chapter Page - - . . . strcpy() General Form: strcpy(Target String, Source String) The strcpy() function takes two arguments: target and source.
It copies the character string pointed by the source to the memory location pointed by the target. The null terminating character (\ ) attached to the string is also copied. #include <string.h> #include <iostream> using namespace std; int main() char source[] = "Computer Science"; char target[ ]="target"; cout<<"\n String in Source Before Copied :"<<source; cout<<"\n String in Target Before Copied :"<<target; strcpy(target,source); cout<<"\n String in Target After strcpy function Executed :"<<target; return ; Program . Output: String in Source Before Copied :Computer Science String in Target Before Copied :target String in Target After strcpy function Executed :Computer Science .
. . strlen() The strlen() takes a null terminated string as its