Join Dan Gookin for an in-depth discussion in this video Solution: Presidents of the U.S.A., part of C: Data Structures, Pointers, and File Systems.
(funky techno music) … - [Instructor] Here is my solution, … which comes in three parts. … First required are these structure definitions, … they must be in this order. … Date first, at line three, … it contains three structure members, … month, day, and year. … Then comes the person structure at line eight, … and it contains two members, a name string, … and then the date structure tookoffice. … This order works because the date structure … is already defined in the source code, … and these structures are declared externally … so that all functions in this file fully recognize them. … The main function creates the presidents array … with four elements. … Now, here, I've preset the values, … organized across several lines. … One set of braces collects all four elements in the array. … Then braces enclose each element, … which are the individual structures, in the array. … And then within the structures themselves, … you see the date structure member … which is enclosed in braces again. …
- 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.