how to access an element in a vector c++ code example
Example: cpp access vector by index
std::vector<int> vecOfNums{ 1, 4, 5, 22, 33, 2, 11, 89, 49 };
// Access element at index 3
int & element = vecOfNums[3];
std::vector<int> vecOfNums{ 1, 4, 5, 22, 33, 2, 11, 89, 49 };
// Access element at index 3
int & element = vecOfNums[3];