Studying for a computer science final......
I really cannot figure this example out.....
I understand that leaving the first argument blank makes it act like TRUE....
but I don't understand what leaving a variable in the second argument accomplishes....
What I don't understand the most is how a printf statement "updates" the variable condition...
#include<stdio.h>
int main()
{
int x=1, y=1;
for(; y; printf("%d %d\n", x, y))
{
y = x++ <= 5;
}
printf("\n");
return 0;
}
The output is:
2 1
3 1
4 1
5 1
6 1
7 0
edit:
I understand now the for-loop structure part.....
Thanks for the answers - very insightful thanks!