Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for loop

Status
Not open for further replies.

keizersoz

Programmer
Apr 22, 2004
67
BE
If in a for loop I want to impose more than one condition, what is the precisie syntax to do that; Should the different conditions only be separated by a ","

I want "do something" to occur only if condition 1 and condition 2 are fulfilled , is this the correct syntax?
Or should I add an and?

for(;condition 1, condition2;)
do something
 
Like
Code:
for ( i = 0 ; i < 10 && !done ; i++ )

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top