www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/13/22:42:01

From: "Marp" <marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP and while loop.
Date: Sat, 13 May 2000 22:46:30 -0400
Organization: MindSpring Enterprises
Lines: 41
Message-ID: <8fl4cb$271$1@slb3.atl.mindspring.net>
References: <fboT4.56105$r37 DOT 670154 AT news20 DOT bellglobal DOT com>
NNTP-Posting-Host: 04.30.99.9e
X-Server-Date: 14 May 2000 02:51:55 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Aleks D." <user AT host DOT com> wrote in message
news:fboT4.56105$r37 DOT 670154 AT news20 DOT bellglobal DOT com...
> Hello,
>
> I am running Windows 98 and DJGPP.  I am a beginner in C and am having
> problems running compiled programs that include a while loop.  I can
> successfully compile the following code from RHIDE:
>
>
> #include <stdio.h>
>
>
> int main()
> {
> int count;
>
>        count = 0;
>
>            while(count < 6);

This line should not have a semicolon at the end. It thinks that while count
< 6 do nothing (; by itself is the null statement) and count never increases
and your program loops forever.

>          {
>            printf("The value of count is %d\n", count);
>            count = count + 1;
>          }
>
> return 0;
> }
>
>
> But when I go and execute the compiled .exe in the /bin directory there is
> no correct output displayed.  I only get a cursor on the left side of the
> screen.  Any help will be appreciated.
>
>


- Raw text -


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