0

I have some problems running my C program of character counting.

I wonder why there is no output whatever the input is. This is my program:

#include <stdio.h>

int main(void)
{
    int nc = 0;
    while (getchar() != EOF)
    {
       ++nc;
    }
    printf("%d\n", nc);
    return 0;
}
Jens
  • 69,818
  • 15
  • 125
  • 179

0 Answers0