Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
#include
#include
using namespace std; int main() { // Create a deque called cars that will store strings deque
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)