online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> // a, b에는 각각 변수 a, b의 주소가 전달됩니다. void swap(int *a, int *b) { // 함수 진입 직전 상태 출력 printf(" [in swap] before swap: *a=%d, *b=%d\n", *a, *b); printf(" [in swap] pointers: a=%p, b=%p\n", (void*)a, (void*)b); // 실제 값 교환 int temp = *a; *a = *b; *b = temp; // 교환 직후 상태 출력 printf(" [in swap] after swap: *a=%d, *b=%d\n\n", *a, *b); } int main(void) { int a = 10, b = 20; // 호출 전 상태 printf("before swap(): a=%d, b=%d\n", a, b); printf("before swap(): &a=%p, &b=%p\n\n", (void*)&a, (void*)&b); // 주소를 넘겨서 실제 변수 값을 교환 swap(&a, &b); // 호출 후 상태 printf(" after swap(): a=%d, b=%d\n", a, b); 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