fgetc

Trouble with characters in C

Hi Why does this not compile? Cant see the error #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { char *c; FILE *f = fopen("file.txt", "r"); if(f == NULL) { printf("Could not open file"); } while((c = fgetc(f)) != EOF) { if(strcmp(c, " ") == 0) { printf(" ");...

fgetc does not identify EOF

Below program runs fine on solaris/linux various flavor, but not on AIX. on AIX while(c!=EOF) if i replace by while(c!=0xff) it just run fine completely Any thought ? i checked the man page of fgetc on aix, and it should return EOF constant ! #include <stdio.h> #include<unistd.h> #include <string.h> int main() { char c; FI...