Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include <iostream> #include <deque> using namespace std; int main() { // Create a deque called cars that will store strings deque<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; // Try to access an element that does not exist (will throw an exception) cout << cars.at(6); return 0; }
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 6) >= this->size() (which is 4)