Join Dan Gookin for an in-depth discussion in this video Challenge: String I/O and manipulation, part of C: Data Structures, Pointers, and File Systems.
(upbeat music) … - [Instructor] This chapter's Challenge comes … as a single program with three parts. … First, fetch string input from the user. … Second, process that input, mixing it … with a string literal to generate a phrase … and third output the phrase. … And now the details for the first part, string input. … Prompt the user to type their name. … Using character input only write a loop that processes … those characters, storing them in a buffer called name. … The buffer should hold 32 characters, … so effectively you're writing … your own text input function for part one. … For part two, you copy the name array of the text input … into a second character buffer called buffer. … Then you take the text from the last array … and append it to text stored in the buffer. … Now the last array is a string literal … and it contains the text passed the challenge. … For the final part you output the contents … of the character array buffer. … Now don't use the puts or printf function … to output the text. …
- 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.