I write a program:
#include <stdio.h>
main()
{
char str[81];
while(1)
{
gets(str);
printf("You input: %s\n",str);
}
My question is why it causes infinitely loop after I press Ctrl-D.Quote:}
Is there any solution about this? Thanks.
--
+------------------------------------------------------------+
/ \ Trying to maintain a good friendship with all people / \
/ + - - - - - - - - - - - - - - - - - - - - - - - - - - - -/ - +
+------------------------------------------------------------+ /
\ /Home Page: http://susis.ust.hk/~enoch \ /
+------------------------------------------------------------+