delorie.com/archives/browse.cgi | search |
From: | Martin Ambuhl <mambuhl AT earthlink DOT net> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Small problem with instruction sorting |
Date: | Mon, 08 Feb 1999 14:21:45 -0500 |
References: | <slrn7bteai DOT elk DOT metalb AT bart DOT us DOT es> |
X-Posted-Path-Was: | not-for-mail |
X-Accept-Language: | en |
X-ELN-Date: | 8 Feb 1999 19:21:41 GMT |
X-ELN-Insert-Date: | Mon Feb 8 11:35:59 1999 |
Organization: | Nocturnal Aviation |
Lines: | 31 |
Mime-Version: | 1.0 |
NNTP-Posting-Host: | 1cust171.tnt11.nyc3.da.uu.net |
Message-ID: | <36BF3949.9B489089@earthlink.net> |
X-Mailer: | Mozilla 4.5 [en] (Win95; I) |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Jaime Tejedor Gomez wrote: > > Hi all > > I've got the following program: > > #include <stdio.h> > #include <stdlib.h> > main() > { > printf("HELLO WORLD. PRESS KEY"); > while(!bioskey(1)); > exit(0); > } > > My question is: > > How can I prevent DJGPP from reordering instruction's ejecution to make it > print the message before waiting for the key? Sorry if that's a dumb > question, but I've searched in FAQ, info and Rhide help and found nothing There is no reordering in the execution. Just place a flush(stdout); after your printf() statement. This is covered in the comp.lang.c FAQ available from ftp://rtfm.mit.edu/pub/usenet. You should get it and use it along with the djgppFAQ. -- Martin Ambuhl (mambuhl AT earthlink DOT net) Note: mambuhl AT tiac DOT net will soon be inactive
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |