delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/12/23:03:48

From: qballlives AT aol DOT com (QBallLives)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why doesn't this work?
Lines: 28
Message-ID: <1998051222453900.SAA22152@ladder01.news.aol.com>
NNTP-Posting-Host: ladder01.news.aol.com
Date: 12 May 1998 22:45:39 GMT
Organization: AOL http://www.aol.com
References: <001101bd7ded$f8a31380$a74e08c3 AT arthur>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>Found a simple password program in QBASIC and as an exercise tried to
>convert it to C. So simple, you may say. It is, but for the life of me I
>could not get printf (of all things) to work.
>
>Source attached.
>
>Yes, I know that it is not optimised fully, but the routine is there and I
>know it works. Why does it not prompt you for your password until after you
>have typed it?
>
>It works if I use cprintf or scanf, so I assume that after printf is used,
>the text is not printed until some interrupt is set off (like a function
>call). I thought it was the simple "print to stdout" routine?
>
>James Arthur
>jaa AT arfa DOT clara DOT net
>
>

The problem could be the buffered input... I don't know what compiler your
using.. .or what command it would be... but flush your buffer before you do the
printf... that might help you...


Jim the loiterer
aloiterer AT juno DOT com
http://members.xoom.com/JimMcCue/index.htm
(Jim the loiterer's PC games, programming, & stuff...)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019