Question: for (int i = 0; i < 5; i++) { cout < < i - postfix++: < < i < < endl; } for
for (int i = 0; i < 5; i++) {
cout << "i - postfix++: " << i << endl;
}
for (int i = 0; i < 5; ++i) {
cout << "i - prefix++: " << i << endl;
}
Hi, I've been struggle about the C++ prefix/postfix increment(decrement) operators...
Why do the prefix increment and postfix increment operators make no difference in the above two code snippets,
and does it happen on the while (do while) loop too?
How do I know if there'll be a change due to prefix or postfix?
Thank you! Upvote for detailed answer for sure!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
