##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Arrays store multiple values of the same type. Learn to declare, access, and iterate over arrays.
The Goal
Indexed containers
Benefits of using arrays
How to declare an array
Understanding fixed sizing
Test understanding
Reading and writing values
Why arrays start at index 0
Zero-based indexing
Invalid index dangers
Test understanding
Providing initial values
When you provide fewer values
C++11 brace initialization
Test understanding
Visiting each element
Traverse and accumulate
Standard iteration structure
Calculate array length
Test understanding
Updating array contents
Processing all elements
Search through array
Locating the smallest element
Locating the largest element
Collection basics
How many meet a condition
Test understanding
How arrays are passed
Why sizeof fails in functions
Why you need a size parameter
Test understanding
Arrays of arrays
Declaring and initializing
Iterating over all elements
Reversing order of elements
Detecting repeated elements
Counting adjacent same colors
Adjacent comparison pattern
Traversal approach
Collection basics
Working solution
What we learned
Filtering with conditions
Difference calculation
Count-as-you-go approach
Collection basics
Working solution
What we learned
What we learned