🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.lang.c++
1 messages
1 total messages Started by Tobias Dussa Wed, 11 Oct 1995 21:39
Re: Problem-Countdown?
#561
Author: 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...
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads