Structures can be organized into arrays just like any other variable. The structure variable name is followed by square brackets and the number of elements in the array. In a structure array, members are referenced after the square brackets and a dot.
- [Instructor] Just like any type of variable in C … you can create an array of structures. … Each structure becomes an element in the array. … The only tricky part is how you reference the structure … members within the array. … In this code the pixel structure is defined in line five. … It has three members, integers, horz, and vert. … And a character color. … The next line 10 creates a pixel structure variable box. … This is an array variable with four elements. … Then several rows of code fill each array element … and structure member. … First comes element 0, the first element of the array. … Check the notation. … The variable name is followed by the brackets … and the array number. … The key to remembering this format is to check how the … variable was declared in line 10. … The brackets follow the variable name not the … member name. … Then for each member of the first element box zero … is used. … In box one, box two and box three, … three members for each of the four elements of the array …
- 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.