Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
#include
#include
#include
using namespace std; int main() { string cars[4] = {"Volvo", "BMW", "Ford", "Mazda"}; int index = 6; try { if (index > 3) { throw out_of_range("The index is too big"); } cout << cars[index]; } catch (const out_of_range& e) { cout << e.what(); } return 0; }
The index is too big