comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Simple ADA/C Question
Date: 1997/02/26
Date: 1997-02-26T00:00:00+00:00	[thread overview]
Message-ID: <33148127.45C@gsfc.nasa.gov> (raw)
In-Reply-To: Pine.LNX.3.95.970226082729.7991A-100000@vf700f.msfc.nasa.gov


Now we need the code for the C function C_Integer_Input. If it uses
scanf with %d (or any integer format), when you feed it a real (like
"123.45"), it will read "123", and leave ".45" still in the input
stream. Then when you run Ada.Text_IO.Get, you get "." in Answer, and
exit the loop.

One "solution" is to do Ada.Text_IO.Skip_Line after Do_C2; this will
throw away any unread characters (up to a line terminator).

-- 
- Stephe




  reply	other threads:[~1997-02-26  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-25  0:00 Simple ADA/C Question root
1997-02-26  0:00 ` Bob Klungle
1997-02-26  0:00   ` root
1997-02-26  0:00     ` Stephen Leake [this message]
1997-02-26  0:00       ` root
1997-02-26  0:00     ` John McCabe
1997-02-26  0:00     ` Robert Dewar
1997-02-28  0:00       ` Keith Thompson
1997-03-02  0:00         ` Robert Dewar
1997-03-04  0:00           ` Keith Thompson
1997-03-04  0:00             ` Robert Dewar
1997-03-04  0:00               ` John McCabe
1997-03-04  0:00                 ` Anders Eliasson
1997-03-04  0:00                 ` Robert Dewar
1997-03-06  0:00                   ` Keith Thompson
1997-03-06  0:00                     ` Larry Kilgallen
1997-03-09  0:00                       ` Robert Dewar
1997-03-06  0:00                     ` Robert Dewar
1997-02-27  0:00 ` Robert Dewar
1997-02-27  0:00   ` root
1997-02-27  0:00   ` root
1997-03-03  0:00 ` Robert I. Eachus
1997-03-05  0:00   ` Robert Dewar
1997-03-05  0:00 ` Jon S Anthony
1997-03-06  0:00   ` Robert Dewar
1997-03-07  0:00 ` Jon S Anthony
1997-03-07  0:00   ` Robert Dewar
1997-03-07  0:00   ` Robert Dewar
1997-03-08  0:00     ` Larry Kilgallen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox