G
Greenhorn
hi,
From reading some guides i understood that prefix, postfix operate
this way, former executes the increment right away, latter executes the
increment after the immediately after the immediately following end of
statement. Is that correct ?
If i go by that rule, the below two statements are equivalent
for(i=0;i < 1;i++)
printf("The first value printed for i is %d", i);
for(i=0;i < 1;++i)
printf("The first value printed for i is %d", i);
The outputs are same here as printf(...) statement above is the
immediately following end of the first statement after the 'increment
operator(s)'
Thanks in advance.
greenhorn.
From reading some guides i understood that prefix, postfix operate
this way, former executes the increment right away, latter executes the
increment after the immediately after the immediately following end of
statement. Is that correct ?
If i go by that rule, the below two statements are equivalent
for(i=0;i < 1;i++)
printf("The first value printed for i is %d", i);
for(i=0;i < 1;++i)
printf("The first value printed for i is %d", i);
The outputs are same here as printf(...) statement above is the
immediately following end of the first statement after the 'increment
operator(s)'
Thanks in advance.
greenhorn.