I know in C++, you're able to peek at the next character by using: in.peek();
.
How would I go about this when trying to "peek" at the next character of a file in C?
I know in C++, you're able to peek at the next character by using: in.peek();
.
How would I go about this when trying to "peek" at the next character of a file in C?
fgetc+ungetc. Maybe something like this:
you'll need to implement it yourself. use fread to read the next character and fseek to go back to where you were before the read
EDIT:
You could use a
getc
followed by anungetc