Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: Mon May 13 10:46:36 CEST 2024

Total time taken to generate the page: 0.04175 seconds