sorry i forgot to post my code
#include <stdio.h> int main() { int i ; int c; while ( ( i = getchar() ) != EOF ) c++ ; printf( "%d characters\n" , c) ; return 0; }
does this seem ok? ... when i run it ./a.out i click enter
then i enter a word say "daniweb" and press enter and then hit ctrl+d and it says 8 characters
where is c initialized ?