有人能帮我解释一下这个问题吗?当我编译它时,它不会满足于任何输入。此外,自我调用主要功能的原因是什么?这个程序做什么? (Self calling main function + getchar)
以下程序做了什么?证明你的答案。
#include <stdio.h>
int main (void) {
int c;
if ((c = getchar()) != EOF) {
main();
printf("%c", c);
}
return 0;
}
查看上一个问题,还有很多其他的:http://stackoverflow.com/questions/7937789/how-does-the-c-code-that-prints-from-1-to-1-000-without-loops - 或 - 条件统计 –
这看起来像一个程序,可以反向打印stdin,但它可能会堆栈溢出的任何大型输入。 –