online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <fstream> class character { public: std::string name; int hp; int dmg; void info() { std::cout << name << " " << hp << " " << dmg << "\n"; } }; int main() { std::ifstream fin("input.txt"); character hero; std::string attr; if (fin.is_open()) { fin >> attr >> hero.name; fin >> attr >> hero.hp; fin >> attr >> hero.dmg; hero.info(); fin.close(); } return 0; }
heroname hero herohp 100 herodmg 15

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