Structures are containers for multiple variables, each of which describes some complex data construction. The structure is defined and named, then variables of that structure type are declared. Structure members are referenced by using the structure variable name, a dot, then the member name. As with other variables, structure member values can be assigned when the structure variable is declared.
- [Instructor] A structure is a container … for multiple variable types. … The variables can be different data types, … the same data types, or mixed and matched … in various quantities. … These variable types are somehow related, … or referenced as a single unit, like a record in a database. … The keyword struct defines the structure. … It's followed by the structure's name … and then the set of braces or curly brackets. … Within the braces are lists of variable declarations. … These become the members of the structure. … To use the structure, … you must create a variable of the structure type. … Structure members are accessed by using … the structure variable name, a dot, … and then the member name as defined in the structure. … So birthday is a structure variable … and month is the name of a member of that structure. … The members work like any individual variable in your code. … They can be assigned values, sent to a function, … used in an equation, and so on. … In this code the pixel structure is declared at line five. …
- 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.