On 11/18/10 17:45, Joy Puglisi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm learning C and this is the program:

#include<stdio.h>
main()
{
     double nc;
     for (nc = 0; gechar() != EOF; ++nc);

This doesn't compile. try getchar() and Ctrl-D does the job.

     printf("%.0f\n", nc);
}

But I just realized I don't know how to do EOF. I tried Ctrl+D but
it just ends the program without displaying any output like printf
says. How do I properly EOF so that it doesn't end the program but
have the particular function read EOF?

Reply via email to