delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/27/14:35:08

Message-Id: <199801271934.IAA29784@cirrostratus.netaccess.co.nz>
Comments: Authenticated sender is <chapmic5 AT pop3 DOT netaccess DOT co DOT nz>
From: "Richard Chappell" <chapmic5 AT cirrostratus DOT netaccess DOT co DOT nz>
To: riker AT pipcom DOT com
Date: Wed, 28 Jan 1998 07:26:54 +0000
MIME-Version: 1.0
Subject: Re: readkey() problem
Reply-to: Pixnaps AT netaccess DOT co DOT nz
CC: djgpp AT delorie DOT com
In-reply-to: <MPG.f36e0bf8faddf6a9896b4@news>

> From:          SPAMGUARDriker AT pipcom DOT com (Matt Riker)
> Subject:       readkey() problem
> Date:          Mon, 26 Jan 1998 18:05:21 -0500
> Organization:  Riker Software
> Reply-to:      SPAMGUARDriker AT pipcom DOT com
> To:            djgpp AT delorie DOT com

> Whenever I use readkey() in place of where getch() would normally be, 
> the line that is supposed to be displayed first (ie. "Press any key...") 
> doesn't display until a key is pressed.  Here is an example:
> 
> {
>    allegro_init();
>    install_keyboard();
> 
>    printf("Hey there!\n");
>    printf("Press any key...");
>    readkey();
>    return 0;
> }
> 
> "Hey there!" gets displayed, but "Press any key..." isn't displayed 
> until a key is pressed.  Can anyone help?  Thanks.

I saw a message posted here recently asking the same sort of 
question. Make it:

printf("Press any key...\n"); 

then it should work. Or else you could do fflush(stdout); or 
something like that I think.

I hope I've helped,
Richard

- Raw text -


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