You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
559 B
Plaintext

// Vectors are sequence containers representing arrays that can change in size.
// Library to include
#include <vector>
vector<int> a; // Declare an empty vector, a.
a.push_back(1); // Appends/Adds an element whose value is 1 to vector a.
std::cout << a.at(0) << std::endl; // Accessing index 0 of vector a.
a.size(); // Returns the size of the vector
a.at(0) = 420; // Changing the value at index 0 to 420.