Mar 1, 2011 at 11:27pm Mar 1, 2011 at 11:27pm UTC
Last edited on Mar 1, 2011 at 11:27pm Mar 1, 2011 at 11:27pm UTC
Mar 1, 2011 at 11:28pm Mar 1, 2011 at 11:28pm UTC
I cant under stand how to use it. Can you explain how I'd do it?
Mar 1, 2011 at 11:31pm Mar 1, 2011 at 11:31pm UTC
1 2 3 4 5 6 7 8 9 10 11
//An example taken from the page on the for loop
#include <iostream>
using namespace std;
int main ()
{
for (int n=10; n>0; n--) {
cout << n << ", " ;
}
cout << "FIRE!\n" ;
return 0;
}
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, FIRE!
EDIT: Dangit again.
-Albatross
Last edited on Mar 1, 2011 at 11:31pm Mar 1, 2011 at 11:31pm UTC
Mar 1, 2011 at 11:35pm Mar 1, 2011 at 11:35pm UTC
Nobody ever said that END_VALUE in Zhuge's example had to be a constant. It could just as easily be a variable or a return value from a function. :)
-Albatross