有人能幫我解釋一下這個問題嗎?當我編譯它時,它不會滿足於任何輸入。此外,自我調用主要功能的原因是什麼?這個程序做什麼? (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,但它可能會堆棧溢出的任何大型輸入。 –