online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; class MyClass { public: int p; public: MyClass( int q ):p(q) { } }; int main() { std::vector<std::pair<int, MyClass>> vec1{{1, MyClass(44)}, {2,MyClass(45)}, {3,MyClass(46)}}; //iterate through the vector and print data member p for(const auto&myPair: vec1) { //-----------------vvvvvvvvvvvvvv-------------->print the data member p std::cout<<myPair.second.p<<std::endl; } }

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