Week 2 Lesson 2
In this lesson, we'll explore one of the most fundamental data structures: arrays. By the end you'll know what makes an array an array, and you'll be be able to write code that declares and uses arrays in C++. You'll also understand how array indexing works in C++, and some of the advantages and disadvantages inherent to array design.
We'll also talk about style and testing.
Learning Goals
This lesson addresses the following Group 2 learning goals:
- Goal 2A: Array Definition — List and define the four fundamental properties of C++'s (primitive) arrays.
- Goal 2B: Array Characteristics — Discuss the advantages and disadvantages of arrays as data structures.
- Goal 2C: Use Arrays — Write code to define and use statically sized arrays of primitives.
- Goal 2D: Array Errors — Predict and interpret errors related to array indexing.
Outline
- Before you start…
- Arrays
- Declaring Arrays in C++
- Accessing Array Elements
- Out of Bounds Access
- Array Example
(This might be a good spot to take a break!)
To receive credit: complete all pages above, then this page will be complete as well (and get a green check emoji at the bottom right of the page).
(When logged in, completion status appears here.)