cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Is there a way to fix or evaluate only o
Is there a way to fix or evaluate only once a var inside a loop ?
Aug 25, 2011 at 6:06pm UTC
tonnot
(335)
If I have:
1
2
3
4
for
(x=0;x<limit;x++) { limit++; }
Is there a trick to fix the x<limit statement?
Ok, I know I could assign a var before the loop, but... is there any trick?
Thanks
Aug 25, 2011 at 6:13pm UTC
Disch
(13742)
Nope. If you are incrementing limit in the loop, but don't want it to change in the condition, you have to use a separate variable. No way around it.
Aug 25, 2011 at 7:17pm UTC
tonnot
(335)
Thanks
Topic archived. No new replies allowed.