Two ctype functions that convert characters are toupper() and tolower(), which convert single characters to their upper and lower case equivalents, respectively. The ctype conversion functions do not affect non-alphabetic characters.
- [Instructor] Most of the C type functions … test for certain character types, … such as uppercase, digits, spaces, and so on. … These are the IS functions. … A second set of C type functions is also available, … those that modify characters. … These aren't as numerous as the IS type functions, … but they're quite handy. … For example, the tolower function converts … an uppercase letter to its lowercase counterpart. … The toupper function does the opposite. … Both functions take an integer as an argument … and they return the modified character value … as an integer. … In this code I have a string defined at Line Six. … It contains a mix of upper and lowercase text. … The while loop at Line 10 walks through … each character in the string, … assigning it to integer variable CH. … When the value of variable CH … is equal to the null character, … the loop stops. … At Line 12, the putchar function outputs each character … as modified by the tolower function. … This function changes only uppercase letters A to Z. …
- Working with arrays
- Building a structure
- Creating an array of structures
- Testing characters
- Working with strings in C
- Using pointers to manipulate data
- Manipulating files
- Using command-line arguments
- Working with time functions
Skill Level Intermediate
1. Arrays and Structures
2. Characters and Strings
4. Files and the Operating System
5. The Interesting and Extraordinary
Next steps1m 52s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.