Which is an invalid access for the vector?
vector<int> numsList(5); int x = 3;
Group of answer choices
numsList.at(x+2)
numsList.at(x-3)
numsList.at((2*x) - x)
numsList.at(0)
Program: C++
Single choice
#include<iostream> #include<vector> using namespace std; int main() { vector<int> numsList(5); int x = 3; //cout<<numsList.at(x+2)<<endl; cout<<numsList.at(x-3)<<endl; cout<<numsList.at((2*x)-x)<<endl; cout<<numsList.at(0)<<endl; return 0; }
numsList.at(x+2)
Get Answers For Free
Most questions answered within 1 hours.