online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <array> #include <algorithm> using namespace std; int main() { try { array<int, 3> a = {3,1,2}; //выводим массив. здесь нет явного использования индексов и размеров for(auto v : a) cout << v << endl; cout << endl; //работают итераторы и стандартные STL алгоритмы sort(a.begin(), a.end()); for_each(a.begin(), a.end(), [](auto v) {cout << v << endl;}); cout << endl; //пытаемся вывести 4ый элемент => вылетает исключение cout << a.at(4) << endl; } catch(const exception& e) { cerr << "error happens:" << e.what() << endl; } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue