online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> //forward declaration so that B can be used in declaration B createB(); class B; class A { public: A() { std::cout << "A"; } //this is declaration B createB(); }; class B { public: B() { std::cout << "B"; } friend B A::createB(); }; //this is definition B A::createB() { return B(); } int main() { A a; B b = a.createB(); }

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