-----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);
    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?
-----BEGIN PGP SIGNATURE-----
Charset: UTF8
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 3.0

wpwEAQMCAAYFAkzlWEcACgkQbgTt4mVjs5Oy5AP/eRNnn7XZ/lpd3oD0x2s9/U/6otU1
gy0aGDUCTFG6ReUrWxiR9aheTb11PGXvBjUVu+VlOQ1i2tSGl+rnX/v3Cz72jfkMYTzl
V6eglODf0gay2LKrdjMPrv/yyBYhaYN7juWC3bBxtw0Ma+mrFJQ3jZSkvWQrxO6+3s37
nQUgPTc=
=BuMa
-----END PGP SIGNATURE-----

Reply via email to