From: engebret@sg1.cr.usgs.gov (Chris Engebretson)
Subject: Re: scanf problem on Vax C vs Dec C
Date: 1997/12/19 [thread overview]
Message-ID: <ELGFsM.Fp9@igsrsparc2.er.usgs.gov> (raw)
In-Reply-To: 67eef5$7ei$1@thefuture.qualcomm.com
In article <67eef5$7ei$1@thefuture.qualcomm.com>, rmoore@qualcomm.com (Ryan Moore) writes:
|> Here's an example of a difference:
|>
|> #include <stdio.h>
|>
|> main()
|> {
|> char bar[50];
|>
|> printf("1: ");
|> scanf("%s", bar);
|>
|> fflush(stdin);
|>
|> printf("2: ");
|> scanf("%c", bar);
|> }
|>
|> On VAX C, the second scanf() will wait until the user enters a character
|> followed by the enter key. On DEC C, the second scanf() will *not* wait for
|> the user to enter a character.
And insofar as the C programming language is concerned, the behavior
of both implementations is absolutely correct.
Regards,
--
Chris Engebretson - Raytheon STX Corporation | Ph#: (605)594-6829
USGS EROS Data Center, Sioux Falls, SD 57198 | Fax: (605)594-6940
http://edcwww.cr.usgs.gov/ mailto:engebret@sg1.cr.usgs.gov
Opinions are not those of Raytheon Systems Company or the USGS.
next prev parent reply other threads:[~1997-12-19 5:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-12-17 5:00 scanf problem on Vax C vs Dec C Robert Young
1997-12-18 5:00 ` Boris Gubenko
1997-12-19 5:00 ` Ryan Moore
1997-12-19 5:00 ` Kaz Kylheku
1997-12-19 5:00 ` Chris Engebretson [this message]
1997-12-19 5:00 ` Ryan Moore
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox