online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> // ν•¨μˆ˜ μ›ν˜• void swap(int*, int*); // 두 μ •μˆ˜λ₯Ό κ΅ν™˜ν•˜λŠ” ν•¨μˆ˜μ˜ μ„ μ–Έ (포인터 λ§€κ°œλ³€μˆ˜ μ‚¬μš©) int main(void){ // ν”„λ‘œκ·Έλž¨ μ‹œμž‘ int a, b; // μ •μˆ˜ν˜• λ³€μˆ˜ a, b μ„ μ–Έ a = 10; // a에 10 μ΄ˆκΈ°ν™” b = 20; // b에 20 μ΄ˆκΈ°ν™” printf("before swap() : a = %d, b = %d\n", a, b); // 호좜 μ „ a와 b의 κ°’ swap (&a, &b); // a와 b의 μ£Όμ†Œ 전달 printf("after swap() : a = %d, b = %d\n", a, b); // 호좜 ν›„ a와 b의 κ°’ return 0; // ν”„λ‘œκ·Έλž¨ μ’…λ£Œ } void swap(int*a, int*b){ // 두 μ •μˆ˜λ₯Ό κ΅ν™˜ν•˜λŠ” ν•¨μˆ˜ μ •μ˜ int temp; // μ •μˆ˜ν˜• λ³€μˆ˜ temp μ„ μ–Έ temp = *a; // 포인터 aκ°€ κ°€λ¦¬ν‚€λŠ” 값을 temp에 μ €μž₯ *a = *b; // 포인터 bκ°€ κ°€λ¦¬ν‚€λŠ” 값을 포인터 aκ°€ κ°€λ¦¬ν‚€λŠ” μœ„μΉ˜μ— μ €μž₯ *b = temp; // temp에 μ €μž₯된 값을 포인터 bκ°€ κ°€λ¦¬ν‚€λŠ” μœ„μΉ˜μ— μ €μž₯ printf("in swap() : a = %d, b = %d\n", *a, *b); // swap ν•¨μˆ˜ λ‚΄λΆ€μ—μ„œ κ΅ν™˜λœ μ‹€μ œ κ°’ 좜λ ₯ }

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