www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/27/20:18:24

Newsgroups: comp.os.msdos.djgpp
From: xlysak <xlysak AT fi DOT muni DOT cz>
Subject: Ghosts in DJGPP :-)
Message-ID: <32ED747F.70BD@fi.muni.cz>
Sender: news AT news DOT muni DOT cz (News Admin)
Organization: Masaryk University,Brno
Mime-Version: 1.0
Date: Tue, 28 Jan 1997 03:37:35 GMT
Lines: 63
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Can someone help me ? 

In my program are two function - first is printf() and second is
getch(), 
but - first is called getch() and then printf(). Ghosts in the GCC :-)? 
All examples showed bellow running correctly in Borland C++ 3.1.

Thanks for all answers !
                               Marian (xlysak AT informatics DOT muni DOT cz)

example --->

void main()
{
   int ch;

   printf("Hi , ");
   ch = getch();
}

Output is (!) :
  (1) - wait for getch()
  (2) - Hi ,

void main()
{
   int ch;

   printf("Hi , ");
   ch = getch();
   cprintf(" everybody.");
}

Output is (!) :
  (1) - wait for getch()
  (2) - everybody.Hi ,

void main()
{
   int ch;

   printf("Hi , ");
   ch = getch();
   printf(" everybody.");
}

Output is (!) :
   (1) - wait for getch()
   (2) - Hi , everybody.

void main()
{
   int ch;

   cprintf("Hi , ");
   ch = getch();
   cprintf(" everybody.");
}

Output is (OK) :
 (1) - Hi ,
 (2) - wait for getch()
 (3) - everybody.

- Raw text -


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