Hi there. I'm trying to figure out some answers to some questions and some difference between While and For loops in C++ and also the reasons? Here's what I've come up with so far. According to http://www.cplusplus.com/doc/tutorial/control/
While is: while (expression) statement
and For is: for (initialization; condition; increase) statement;
so in a for loop, the initialization is where we declare the variable to be used in the condition statement right?
The condition is under what conditions, will it loop.
Then increase is where we decide how much to add or subtract to the variable.
In a while loop the expression is also a condition right? Or are they completely different terms in this case?
I noticed that with the for loop I can move the increase part to the statement if I want to but I can't in a While loop put an increase in parenthesis or declare a variable in the parenthesis (that initialization thing in a for loop). I was kind of curious what the reason is?
Anyways, I'm kind of teaching myself with the help of google, and advice from people, I'm pretty much completely new to programming so please take it easy on me, I'm not up to date with Jargon or complicated answers yet. :) If you need more information or anything please tell me.