Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: ungetc/scanf independent? Message-ID: <1238@sdrc.UUCP> Date: 28 Mar 90 22:08:50 GMT References: <3009.260C8D7C@puddle.fidonet.org> Organization: SDRC, Cincinnati Lines: 25 In article <3009.260C8D7C@puddle.fidonet.org>, cspw.rures@p0.f4.n494.z5.fidonet.org (cspw rures) writes: > I have a VAX problem when interleaving calls to getc and ungetc with > calls to scanf. On all the compilers I tested (except the VAX VMS 4.2), > and "ungetc" character is available to a subsequent scanf. On the VAX > it appears that getc and ungetc have their own private "view" of the file, > not shared by scanf. > > Is the VAX C compiler broken? What does ANSI say? The ANSI standard says that all I/O is done "as if" by calls to getc and putc. Thus, if you ungetc a character, it is available to scanf. Is the Vax C compiler broken? Maybe, but that's irrelevant. The Vax C Run Time Library definitely is in VMS V4.2! Since the library comes with VMS, not with the compiler, and VMS is now up to V5.3 or so, you're a little behind the times. I suggest updating ASAP. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You know how Einstein got bad grades as a kid? Well MINE are even WORSE!" -Calvin