Join Dan Gookin for an in-depth discussion in this video Challenge: Presidents of the U.S.A., part of C: Data Structures, Pointers, and File Systems.
(upbeat music) … - [Instructor] For this chapter's challenge … you are to construct an array of structures. … The array has four elements, four structures. … You are to display the four structures, … then you're to swap two elements in the array, … and then display the four structures again. … Now, to pull off this challenge, … you'll need to define two structures. … The first is a person structure. … It contains two members, a character array name, … which is a string of 32 characters, … and a second member, date, which is called tookoffice. … This structure has three integer members, … month, day, and year. … What you're cobbling together here is this data, … the four US presidents who appear … on the Mount Rushmore monument, … Washington, Jefferson, Lincoln, and Roosevelt, … along with the date they took office, which is shown here. … Again, the code you create to solve this challenge … takes the data provided, which I'll show again, … and it puts it into an array … of person structures named president. …
- 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.