Saved Bookmarks
| 1. |
Vectors |
|
Answer» #include <vector> int main() { vector<int> grade(3); grade[0] = 90; grade[1] = 80; grade[2] = 70; return 0; } A vector in C++ is a dynamic list of things that can expand and shrink in size. It can only hold values of the same type. It is important to #include the vector library in order to use vectors. vector<string> wishlist;wishlist.push_back("Furniture"); wishlist.push_back("Basket"); wishlist.pop_back(); cout << wishlist.size(); // returns the output 1
|
|