online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; int main() { int tmpVal1 = 2023; int tmpVal2 = 8; int &leftRef = tmpVal1; cout << "(after) int &leftRef = tmpVal1;" << endl; cout << "&leftRef=" << &leftRef << ", leftRef=" << leftRef << endl; cout << "tmpVal1=" << tmpVal1 << ", tmpVal2=" << tmpVal2 << endl; cout << "--------------" << endl; leftRef = 1970; cout << "(after) leftRef = 1970" << endl; cout << "&leftRef=" << &leftRef << ", leftRef=" << leftRef << endl; cout << "tmpVal1=" << tmpVal1 << ", tmpVal2=" << tmpVal2 << endl; cout << "--------------" << endl; leftRef = tmpVal2;//tmpVal2의 값만 가져오게 됨. tmpVal2 = 9; cout << "(after) leftRef = tmpVal2;" << endl; cout << "&leftRef=" << &leftRef << ", leftRef=" << leftRef << endl; cout << "tmpVal1=" << tmpVal1 << ", tmpVal2=" << tmpVal2 << endl; cout << "--------------" << endl; 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