delorie.com/archives/browse.cgi | search |
From: | "A. Sinan Unur" <sinan AT unur DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: DJGPP and while loop. |
Date: | Sun, 14 May 2000 10:51:02 -0400 |
Organization: | http://unur.com/ |
Lines: | 37 |
Sender: | verified_for_usenet AT cornell DOT edu (asu1 on ip236.ithaca.ny.pub-ip.psi.net) |
Message-ID: | <8fmeig$6pq$1@news01.cit.cornell.edu> |
References: | <fboT4.56105$r37 DOT 670154 AT news20 DOT bellglobal DOT com> |
NNTP-Posting-Host: | ip236.ithaca.ny.pub-ip.psi.net |
X-Trace: | news01.cit.cornell.edu 958315920 6970 38.10.16.236 (14 May 2000 14:52:00 GMT) |
X-Complaints-To: | usenet AT news01 DOT cit DOT cornell DOT edu |
NNTP-Posting-Date: | 14 May 2000 14:52:00 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); you have an infinite loop here. putting a semicolon after the test condition of if/while/for statements, it has the effect of typing while( count < 6 ) { }. that is, count is never modified in the body of the while loop, so count is always less than 6. by the way, general C related questions belong in comp.lang.c or comp.lang.c.moderated. -- mailto:Sinan_Unur AT mail DOT com http://unur.com/howto/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |