0
이 코드는 codegolf.stackexchange 사이트에서 발견되었습니다.C, 가변 인자 함수 및 stdarg.h
#include <stdio.h>
#define function int
#define var int
struct { int (*log)(const char *,...); } console = { printf };
/* From here on only JavaScript! */
function fac(x){
if(x < 2) return 1;
return x * fac(x - 1);
}
function main(){
console.log("Hello world!\n");
for(var i = 0; i < 10; i++){
console.log("%i! = %i\n", i, fac(i));
}
return 0;
}
// *Should* we export the main function of this library??/
exports.main = main;
내 질문은, 어떻게 그와 stdarg.h를 포함하지 않고 가변 기능을 실행할 수있다?