for and do while loops

I this notation:

for (; *strings[i]; i++)

the same as:

1
2
3
do {
  i++
} while(*strings[i]);


?
No.

for (; *strings[i]; i++)

is equivalent to:

while (*strings[i]) i++;

http://ideone.com/FOqzJi
Last edited on
for loops:
1) initialize (everything between the '(' and the first ;),
2) check the condition (between the first and second ;)
3) execute the code that belongs to it
4) execute everything between the second ; and the ')'
5) repeat steps 2-4 until the condition is false
Topic archived. No new replies allowed.