Mail Archives: djgpp/1998/05/13/04:32:31
From: | "Martin Ambuhl" <mambuhl AT tiac DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Why doesn't this work?
|
Date: | Wed, 13 May 1998 04:23:07 -0400
|
Organization: | Who wants to know?
|
Lines: | 29
|
Message-ID: | <6jbl14$tv@news-central.tiac.net>
|
References: | <001101bd7ded$f8a31380$a74e08c3 AT arthur>
|
NNTP-Posting-Host: | p18.tc3.newyo.ny.tiac.com
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Arthur wrote in message <001101bd7ded$f8a31380$a74e08c3 AT arthur>...
: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?
===============
Being allergic to the evils that can hide in encoded attachment, I have not
looked at your code. The answer, however, is that input and output
streams are asynchronously buffered. If you use a prompt with a
terminal \n, follow the printf with fflush(stdout);
==============
:
: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
:
:
:
- Raw text -