From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,90f687f65a66617e X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Simple ADA/C Question Date: 1997/02/26 Message-ID: <33148127.45C@gsfc.nasa.gov>#1/1 X-Deja-AN: 221617184 References: <01bc23b2$ecc64960$64e2b8cd@p5120.bda> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1997-02-26T00:00:00+00:00 List-Id: 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