--- In [email protected], andrew clarke <m...@...> wrote:
>
> On Wed 2009-11-25 14:48:42 UTC-0000, johnmatthews2000 (jm5...@...) wrote:
> 
> fgets() returns a pointer, not an integer.

0 in a pointer context is the null pointer, which is what I meant - I should 
have made that clear.

> Normally you'd do something like:
> 
>   p = fgets(s, sizeof s, fp);
> 
>   while (p != NULL)
>   {
>       print("%s", p);
>       p = fgets(s, sizeof s, fp);
>   }

Well, something like it I suppose :-)

  while (fgets(s, sizeof s, fp))
  {
      printf("%s", s);
  }
  :

Reply via email to