Join Dan Gookin for an in-depth discussion in this video Manipulating single characters, part of Up and Running with C.
- So much goes on with characters that the C library…offers a host of character manipulation functions.…In this movie, I introduce a few of those functions…and show you how to use them in your code.…As a bonus, I offer an introduction to logical expressions,…which can also come into play when working with characters.…In your C code, characters appear either individually…or marching along in an array called a string.…So you can manipulate characters one at a time,…or, more commonly, in the string.…
This code includes a ctype header file…which prototypes the character testing…and manipulation functions.…At lines eight and nine, you see…the 'toupper' and 'tolower' functions.…The 'toupper' function generates…the uppercase version of a letter.…'Tolower' generates the lowercase.…The results are used immediately in the printf functions.…Note that these functions require integer values,…not characters.…So you can display the result…by using %c in the printf function…even though they are integer variables.…
Build and run the code.…
- Understanding a C program
- Adding comments
- Using escape characters
- Working with values and placeholders
- Introducing variables
- Making a decision with if
- Adding functions
- Manipulating strings
- Building arrays
- Nesting structures
Skill Level Beginner
1. Getting Started
2. Programming Basics
3. Program Flow Control
4. Intermediate C Language Concepts
5. Advanced C Language Concepts
Next steps2m 11s
- 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.