C++ Vector3 [Notes] Ch.20 More Data Structures (Runestone) EXERCISE) Printing a Vector of int Write a function that prints out the contents of a vector of int. II. Vectors of Vectors 1. Review: declaring the element type of a vector (1) Declare a vector like this: => In addition to the base type of vector, provide the type of elements it will hold. (2) A vector can store elements of any type, as long as they match the type with which it is declared. 2. .. 2022. 12. 6. [Notes] Ch.19 Structs (Runestone) I. Introduction 1. Modeling Real-World Objects in Code (1) Let’s model the autonomous rovers used to explore the dark side of Proxima b. => This proliferation of variables will quickly become unmanageable. (2) Using vectors: Vectors can store sequences of objects => We no longer need an arbitrary large number of variables. The vectors just grow to accommodate new rovers. => However, each attribu.. 2022. 12. 6. [Notes] Ch.18 Program Design in C++ (Runestone) I. Introduction 1. Bottom-up design: starts by identifying specific features that we’ll need in our program, and then writing functions that accomplish these specific features. 2. Top-down design: starts by looking at the big picture of what the end result will be, and then breaks it down into smaller steps after that. II. Bottom-up Design We need to first think of some small pieces of functiona.. 2022. 12. 5. 이전 1 다음