title: In C, is it possible to read a char from getchar's current buffer position without moving the buffer's pointer?
body: <p>I have a file that's been passed as stdin in my program. Every iteration of a very large loop, a method "get_next" calls getchar, and gets the next char in stdin and assigns it to a variable named nchar.</p>
  
  <p>The problem is, I have an instance where I have to look at the char after the current nchar without changing what the next call to get_next does. Meaning, I have to call getchar() without it changing the buffer's state.</p>
  
  <p>Is there a way to do this? Is there a method like "getcharStatic" that returns the next char without changing the buffer, à la peek vs pop for a stack?</p>
  
  <p>Alternatively, is there a way to read the char normally with getchar and then insert the char right where I took it from, thereby artificially conserving the buffer's state?</p>
  
  <p>I tried googling for a while, and I think the problem involves too vague terms and tags. Thanks for any help!</p>