
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to string handling and manipulation in c programming language. It covers various functions such as isdigit(), isalpha(), isalnum(), islower(), isupper(), tolower(), toupper(), isspace(), iscntrl(), ispunct(), isprint(), isgraph(), atof(), atoi(), atol(), strcpy(), strncpy(), strcmp(), strncmp(), strcat(), strncat(), strlen(), strchr(), strcspn(), strspn(), strpbrk(), strrchr(), and strstr(). The document also includes examples of using these functions.
Typology: Slides
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























String Handling
Character
Example 1
ctype Functions int isdigit ( int c ) int isalpha ( int c ) int isalnum ( int c ) int isxdigit ( int c ) int islower ( int c ) int isupper ( int c ) int tolower ( int c ) int toupper ( int c ) int isspace ( int c ) int iscntrl ( int c ) int ispunct ( int c ) int isprint ( int c ) int isgraph ( int c )
isalpha ( ) Function int isalpha ( int c ) ;
isalnum ( ) Function int isalnum ( int c ) ;
isupper ( ) Function int isupper ( int c ) ;
tolower ( ) Function int tolower ( int c ) ;
getchar ( ) ;
cout << “Please enter a character string then press enter”; while ( ( c = getchar ( ) ) != ‘\n’ ) { if ( islower ( c ) ) lc ++ ; else if ( isupper ( c ) ) uc ++ ; else if (isdigit ( c ) ) dig ++; else if ( isspace ( c ) ) ws ++ ; else if ( ispunct ( c ) ) pun ++ ; else oth ++ ; }
atoi ( ) Function char str [ ] ; int age ; age = atoi ( str ) ;
atof ( ) Function