Learn C++ STL

Lesson 3 of 9 · array and deque: Fixed Size, and Growing at Both Ends

Module 4 · array and deque: Fixed Size, and Growing at Both Ends

Full Programs: From a Week of Readings to a Ticket Line

Free with an accountReading

In the C track you stored a week of readings in int temps[7]. Handed to a function, that array arrived as a pointer, and sizeof inside the function said 8, not 28. This lesson starts from the same week, now in an array<int, 7> that a function receives whole and that still knows it holds 7. Six programs follow, each a little bigger. Read the "new thing" line above each one first; it is what that program is for.

Checking what this lesson needs for you…

What is inside Full Programs: From a Week of Readings to a Ticket Line

  1. Program 1: a week of temperatures
  2. Program 2: a 3 by 3 board
  3. Program 3: the last k readings
  4. Program 4: Alice's shop line
  5. Program 5: a playlist that goes round
  6. Program 6: a bounded undo historyIntermediate