TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: John Poltorak
from: Andrew Grillet
date: 1995-03-25 12:08:22
subject: Re: scanf

-=> On 22 Mar 95  21:28:58 John Poltorak said to All <=-

 JP> This is supposed to prompt the user for two values and compute the
 JP> result.
 JP> When I run this program, I don't get any prompts, before entering any
 JP> values. Is this just a quirk of using an OS/2 compiler, or is Mr.
 JP> Schildt in error here?
Arrh, Jim lad, 'tis a terrible thing, this C stuff....
You need to 'flush the buffer' to get the prompt stuff written. There
are two ways ...

call fflush() after writing the prompt stuff.

tell the system to do this automatically with

setvbuf()

check the online doc'n to find out about these. IMHO, using fflush() is
more likely to be portable.

The reason you don't need this in most DOS systems is cos DOS is trash.

Andrew


 
... If love is blind, why is lingerie so popular?
--- Blue Wave/Max v2.12 OS/2 [NR]
* Origin: Me/2 (2:254/259)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 254/259 1 255/1 440/4 141/209 270/101 105/103 42 712/515 711/808 809
@PATH: 711/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™.