Join Peggy Fisher for an in-depth discussion in this video Arrays, part of Up and Running with C++.
…An array is a tool used in…most programming languages, that allows us to store…and work with multiple values of the same data type, using a single variable name.…This is a very useful way to handle…problems requiring multiple values of the same data type.…The values in the array are stored in consecutive memory locations.…The syntax for creating an array is data…type, the variable name, square brackets, and the size.…Arrays must be declared with the size or they must have an initializer list.…Each element in the array is accessed using…a subscript value, which indicates its position in memory.…
In this example program, I'm showing you some array declarations.…One is a string array for Four Seasons, the…next is an integer array that holds ten numbers.…Then I have a for loop to fill that array with ten random integers.…I have another string array using string weekdays.…This time I'm using an initializer list to initialize…the array to the seven days of the week.…The seasons I'm actually putting values in using the subscript values.…
- Downloading and exploring the C++ IDE
- Working with loops
- Using predefined functions
- Creating custom functions
- Creating and instantiating classes
- Working with external files
Skill Level Beginner
1. Getting Started
2. C++ Basics
3. Flow of Control
4. Classes and Objects
5. Data Structures
6. File Manipulation
- 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.