online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> int main(void) { int num = 50; // num ๋ณ€์ˆ˜ ํ•˜๋‚˜๋งŒ ์กด์žฌ int *pnum; // ์ •์ˆ˜ํ˜• ํฌ์ธํ„ฐ ์„ ์–ธ pnum = &num; // pnum์ด num์˜ ์ฃผ์†Œ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋„๋ก ์ดˆ๊ธฐํ™” // 1) *(pnum) ์€ pnum์ด ๊ฐ€๋ฆฌํ‚ค๋Š” ์ฃผ์†Œ(=num)์˜ ๊ฐ’์„ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ printf("*(pnum) = %d\n", *(pnum)); // 50 // 2) *(pnum++) ์€ โ€œํ›„์œ„ ์—ฐ์‚ฐ์žโ€์ด๋ฏ€๋กœ // (a) *(pnum)๋ฅผ ๋จผ์ € ํ‰๊ฐ€ โ†’ 50 ์ถœ๋ ฅ // (b) ๊ทธ ๋’ค์— pnum = pnum + 1; (์ฃผ์†Œ๊ฐ€ ๋‹ค์Œ int ํฌ๊ธฐ๋งŒํผ ์ฆ๊ฐ€) printf("*(pnum++) = %d\n", *(pnum++)); // 50 // ์ง€๊ธˆ pnum์€ num ๋ฐ”๋กœ ๋‹ค์Œ ๋ฉ”๋ชจ๋ฆฌ(์ •์˜๋˜์ง€ ์•Š์€ ์˜์—ญ)๋ฅผ ๊ฐ€๋ฆฌํ‚ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. // 3) *(++pnum) ์€ โ€œ์ „์œ„ ์—ฐ์‚ฐ์žโ€์ด๋ฏ€๋กœ // (a) pnum = pnum + 1; โ†’ ๋‹ค์‹œ ํ•œ ๋ฒˆ ๋‹ค์Œ int ํฌ๊ธฐ๋งŒํผ ์ฆ๊ฐ€ // (b) *(pnum)๋ฅผ ํ‰๊ฐ€ โ†’ ์ •์˜๋˜์ง€ ์•Š์€(์“ฐ๋ ˆ๊ธฐ) ๊ฐ’ printf("*(++pnum) = %d\n", *(++pnum)); // ์˜ˆ์ธก ๋ถˆ๊ฐ€ (์“ฐ๋ ˆ๊ธฐ ๊ฐ’) 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