Using a space ( " ") in fscanf format forces it to read and discard spaces in the input until it finds a character without spaces, leaving that character without spaces in the input as the next character to be read, So you can do such things , as:
fscanf(file, " ");
getc(file);
fscanf(file, " ");
getc(file);
or
fscanf(file, " %c %c", &char1, &char2); // read 2 non-whitespace characters, skipping any whitespace before each
source
share