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#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <iostream> #include <map> #include <string> int main() { std::map<std::string, int> m = {{"one", 1}, {"two", 2}, {"three", 3}}; auto& kv = *m.find("three"); kv.second = 4; // так можно //kv.first = "four"; // так не даст компилятор const_cast<std::string&>(kv.first) = "four"; // но если мы его заставим силой std::cout << "one: " << m["one"] << "\n\n"; // у нас сломается в другом месте for (const auto& [key, value] : m) { std::cout << key << ":" << value << " "; // и мало того, что мапа не отсортирована, так там еще и два одинаковых ключа с разными значениями } 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