online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> class cookie{ public: int var; int cookie::*p_member=&cookie::var; //p_member can point to an int data member of an cookie object }; int main(){ cookie cold{}; std::cout << "Type what you want into the cookie p_member variable " << std::endl; std::cin >> cold.*cold.p_member; //take input from user directly into var using member pointer syntax std::cout << "var: " << cold.var << std::endl; //print var to confirm that it is correctly set }

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