TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: John Poltorak
from: Ian Timms
date: 1995-03-29 01:06:04
subject: scanf

On the 03-23-95, John Poltorak was chatting with All:

JP>Wednesday March 22 1995, John Poltorak writes to All:
JP>
[deletia]
JP> JP>         printf("Enter length: ");
[deletia]
JP> JP> I'm using ICC from C Set/2 v1.0 and this is what the output
looks like:-
JP>
JP> JP> [F:\dev\c]ex3
JP> JP> 12
JP> JP> 15
JP> JP> Enter length: Enter width: area is 180
JP> JP> [F:\dev\c]
JP>
JP>Having just installed emx+gcc, I now get the expected results, viz:
JP>
JP>[F:\dev\c]ex3
JP>Enter length: 12
JP>Enter width: 15
JP>area is 180
JP>[F:\dev\c]
JP>
JP>I am simply stunned to find ICC acting in such an erroneous way with 
JP>something so trivial. I also got unexpected results when 
JP>displaying numbers of type 'double'. All this makes me 
JP>rather hesitant about learning 'C' using the C Set/2 
JP>compiler. I guess I'll move over to GCC for the time being.

Another thread running in this echo indicates that the printf output
is not actually flushed to the device until a '\n' is encountered,
thus your original would require 'printf("Enter length:\n");' 

Not nice and not what one would expect I agree.

 Cheers, Ian.

 Internet:itimms{at}ariel.ucs.unimelb.edu.au   CIS:100236,1404   [Team OS/2]
___
 * MR/2 2.1 #141 * Windows eh! And I thought it was the salmon moose!

--- Maximus/2 2.02
* Origin: Bunyip's Cave BBS - +61-3-859-8194 (3:633/379)
SEEN-BY: 620/243 632/103 341 348 363 633/379 635/503 640/820 690/660 711/409
SEEN-BY: 711/410 413 430 807 808 809 934 949 955 712/515 713/888 800/1
SEEN-BY: 7877/2809
@PATH: 633/379 632/348 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.