online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <map> #include <vector> #include <utility> #include <iostream> std::pair<int,float> column_max(const auto & m, int column) { int index = -1; float maximum = -std::numeric_limits<float>::max(); for (const auto & [key,value] : m) if (value.size() > column && value[column] > maximum) { index = key; maximum = value[column]; } return {index,maximum}; } int main() { const std::map<int,std::vector<float>> m = { {0, { 1, 5, 10, 22}}, {1, {31, 5, 10, 12}}, {2, { 1, 15, 18, 12}} }; for (int i=0; i<4; i++) { const auto [index,maximum] = column_max(m,i); std::cout << "#" << i << ": " << maximum << " " << index << "\n"; } 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