Possible Duplicate:
int c = getchar()?
#include <stdio.h>
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
I dont have experience with C but i know C++ .I want to ask that 'c' here is declared as an integer type but surprisingly when i run this program , it accepts even characters . Can anyone kindly explain .
Ref : C programming Ritchie/kernighan