adding line breaker

This commit is contained in:
Jidong Xiao
2023-09-01 00:48:26 -04:00
parent 1d24e00c89
commit 7775d692bc

View File

@@ -41,14 +41,15 @@ where h is as defined above.
## 2.3 STL Vectors: a.k.a. “C++-Style”, “Smart” Arrays ## 2.3 STL Vectors: a.k.a. “C++-Style”, “Smart” Arrays
- Standard library “container class” to hold sequences. - Standard library “container class” to hold sequences.
- A vector acts like a dynamically-sized, one-dimensional array. - A vector acts like a dynamically-sized, one-dimensional array.
Capabilities: Capabilities:
– Holds objects of any type. – Holds objects of any type.
– Starts empty unless otherwise specified. – Starts empty unless otherwise specified.
– Any number of objects may be added to the end — there is no limit on size. – Any number of objects may be added to the end — there is no limit on size.
– It can be treated like an ordinary array using the subscripting operator. – It can be treated like an ordinary array using the subscripting operator.
– A vector knows how many elements it stores! (unlike C arrays) – A vector knows how many elements it stores! (unlike C arrays)
– There is NO automatic checking of subscript bounds. – There is NO automatic checking of subscript bounds.
Here’s how we create an empty vector of integers: Here’s how we create an empty vector of integers:
```cpp ```cpp
std::vector<int> scores; std::vector<int> scores;