Original Post
According to what we studied in class and the documentation we were given, fscanf() should skip whitespace, but it's not doing it in my program. I tried testing it in a small separate program: a.txt contains only two characters, a space and 'g'. I would expect that after the first call to fscanf(), ch would contain 'g', but instead it contains the space. After the second call, it contains 'g'. What am I missing? Thanks in advance. [Edited by - Gage64 on September 7, 2008 11:20:42 AM]
void main() {
char ch;
FILE *file;
file = fopen("d:/a.txt", "r");
fscanf(file, "%c", &ch);
fscanf(file, "%c", &ch);
fclose(file);
}