delorie.com/djgpp/doc/libc/libc_837.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

ungetc

Syntax

 
#include <stdio.h>

int ungetc(int c, FILE *file);

Description

This function pushes c back into the file. You can only push back one character at a time.

Return Value

The pushed-back character, or EOF on error.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

 
int q;
while (q = getc(stdin) != 'q');
ungetc(q);


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004