home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
C
/
SMALL_C
/
UNGETC.C
< prev
next >
Wrap
Text File
|
1987-10-04
|
384b
|
14 lines
#define NOCCARGC /* no argument count passing */
#include stdio.h
extern Unextc[];
/*
** Put c back into file fd.
** Entry: c = character to put back
** fd = file descriptor
** Returns c if successful, else EOF.
*/
ungetc(c, fd) int c, fd; {
if(!Umode(fd) || Unextc[fd]!=EOF || c==EOF) return (EOF);
return (Unextc[fd] = c);
}