online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <stdarg.h> // va_list, va_start, va_arg, va_end가 정의된 헤더 파일 void printNumbers(int args, ...) { va_list ap; va_start(ap, args); for(int i = 0;i<args;i++) { printf("%d ",va_arg(ap, int)); printf("%p ",ap); // va_arg에서 분명히 이동을 했을텐데 왜, 그대로인가? } va_end(ap); printf("\n"); printf("%p\n",ap); // ap의 주소값이 아직 남아있음. } int main() { printNumbers(1, 10); // 인수 개수 1개 printNumbers(2, 10, 20); // 인수 개수 2개 printNumbers(3, 10, 20, 30); // 인수 개수 3개 printNumbers(4, 10, 20, 30, 40); // 인수 개수 4개 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