#6443: 拜託,請幫忙指點我的錯誤


ken82098580 (ken)



#include<stdio.h>
#include<stdlib.h>
int main(void)
{
char s[20];


while(gets(s)!=EOF)
{
printf("hello, ");
puts(s);
}
return 0;
}
請問,問題出在哪呢?
結果,逾時出錯
#6505: Re:拜託,請幫忙指點我的錯誤


WilsonHuang (Wilson)


 
#include
#include
int main(void)
{
char s[20];


while(gets(s)!=EOF)
{
printf("hello, ");
puts(s);
}
return 0;
}
請問,問題出在哪呢?
結果,逾時出錯

while(gets(s)!=NULL)