Possible Duplicate:
C equivalent to fstream's peek
Say I have a file with characters in it. I want to look at what the next character is without moving the pointer, just to "peak" at it. how would I go about doing that?
FILE *fp;
char c, d;
fp = fopen (file, "r");
c = getc(fp);
d = nextchar?
How do I look at the character that comes next without actually calling getc again and moving the pointer?