🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #561

Re: Problem-Countdown?

#561
From: Tobias Dussa
Date: Wed, 11 Oct 1995 21:39
35 lines
1394 bytes
In article <5vS4hQwd$wB@p0000328.admiral.berlinet.de>,
Marco Linke <mac@admiral.berlinet.de> wrote:


>Hi,
Hallo!


>   do {
>       for (x = 10; x < 1; --x)
                    ^^^^^^
                    Hier ist dein Problem. Der zweite Ausdruck einer
for-Schleife ist die Bedingung, die entscheidet, ob die for-Schleife
beendet oder nochmal ausgef"uhrt wird. In deinem Fall w"urde hier ein
x > 0 besser passen.

>       while (x !=0);
Und die do-while-Schleife ist v"ollig "uberfl"ussig IMHO. Eine einfache
for-Schleife a la
   int x; for (x = 10; x > 0; x--) foo();
macht genau das, was du willst.

Hoffe, geholfen zu haben (obwohl das IMHO kein C++-, sondern ein
C-Problem war ;)).

Regards,
Toby.
--
Tobias Dussa (Sarstedt, Germany)                         tdussa@candra.han.de

Microsoft Network is prohibited from redistributing this work in any form, in
whole or in part.   License to distribute this post is available to Microsoft
for $499. Posting without permission constitutes an agreement to these terms.

Newton is dead, Einstein has died... And I feel kinda funny, too...
Technical Details
Message-ID: <813447540snx@candra.han.de>
Path: arc1-ca.pugleaf.net!lha.han.de!candra!tdussa

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!lha.han.de!candra!tdussa
From: tdussa@candra.han.de (Tobias Dussa)
Newsgroups: de.comp.lang.c++
Subject: Re: Problem-Countdown?
Distribution: world
Message-ID: <813447540snx@candra.han.de>
Date: Wed, 11 Oct 95 21:39:00 GMT
Organization: Private UUPC site