U++ framework
Do not panic. Ask here before giving up.

Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Multiple statements in for loop
Re: Multiple statements in for loop [message #18437 is a reply to message #18436] Tue, 30 September 2008 20:44 Go to previous messageGo to previous message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
Why do you not use something like this?
for(bool first = true, cond = true;
    first==true||cond==true;
    cond=!(a>=3),first=false)
{
    a++;
}

In that way you keep both variables defined in for loop.


cdabbd745f1234c2751ee1f932d1dd75
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: explanation of c++ typedef line
Next Topic: I don't get some aspects of STL ... [pointless rant]
Goto Forum:
  


Current Time: Tue Aug 04 00:14:25 GMT+2 2026

Total time taken to generate the page: 0.00850 seconds