Basically, this loop is given three commands. The first command tells it that the integer "begin" is being used. The second command tells it to display what is inside the loop while it is less than or equal to 100. The final statement tells the program to increment each time the loop is passed. Inside the loop, the integer "begin" is displayed, and the compiler sleeps for two milliseconds in between each display.cout << "Beginning download" << endl;int begin = 1;for(begin; begin <=100; begin++){cout << begin << endl;Sleep(200);}
Once compiled and run, this loop displays the numbers 1 through 100, with a two millisecond delay in between.
19 comments:
interesting but again I got confused in all of that
i respect u alot for understanding all this o_o
so basically a countdown?
looking good m8
You can declare your "begin" variable in the for loop, the compiler will optimize this kind of thing anyway.
It's not uncommon to see:
for(int i = 1; i <= 100; i++) ;
for(int i = 0; i < 100; i++) ;
for(int j = 0; j < 50; j++) ;
right on!!
My god... I actually understood this one! :D
I may try it later.
Great post, only just understood it tho
What happyhacker said :)
how do you understand any of this :|
That's pretty cool, I wish I could write things like this. So complicated though!
Saving your posts so I can maybe understand someday haha :)
Kinda understand it, but I'm not as smart as you with this, haha!
Looking good thank you!
i can't wait till i start with coding this holiday
What platform is this wep cracking game going to be on?
Good stuff.
Interesting stuff
Post a Comment