2021年1月17日星期日

Prefix vs postfix in a for loop

In a for loop, because the last (update) expression cannot involve assignment, is it trivial whether it uses prefix or postfix increments/decrements? For example:

for (int i=0; i < 10; i++) {...}  

vs.

for (int i=0; i < 10; ++i) {...}  

Would there ever be a case where doing a prefix or postfix would matter in the update expression of a for loop?

https://stackoverflow.com/questions/65768977/prefix-vs-postfix-in-a-for-loop January 18, 2021 at 12:50PM

没有评论:

发表评论