I am doing the char count sample program.
When I do ctrl-d to end the program it returns the number of characters including a D after it. Is this normal? I am on freebsd 9.1 using cc.
Code:
#include<stdio.h>
main()
{
double nc;
for (nc = 0; getchar() != EOF; ++nc)
;
printf("%.0f\n",nc);
}
When I do ctrl-d to end the program it returns the number of characters including a D after it. Is this normal? I am on freebsd 9.1 using cc.