That's interesting. It also means that this is legal:
Though personally I always thought it was not, and hence read the standard for the for loop with this assumption.Code:while (int i = 1) { int i = 0; }
That's interesting. It also means that this is legal:
Though personally I always thought it was not, and hence read the standard for the for loop with this assumption.Code:while (int i = 1) { int i = 0; }
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
this is not clear... The condition in the () is checked on every iteration...It also means that this is legal:
does it mean that the int i is executed on every iteration? then the scope of the variable will be the same as the second i...
if not - it will be something very tricky...
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
More or less. This will help.
Again according to the standard:
Originally Posted by 6.5.1.2
Last edited by Mario F.; 11-29-2006 at 09:59 AM.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.