Nov 7 · 1 min read
You misunderstood the point of the pseudocode, which is why it doesn’t make sense.
int foo = 5;
int bar = foo++;In this case, bar would end up being 5, whereas foo is 6. This is what the author meant to imply with the example he gave. The pseudo code he gave was an implementation of the ++ post-increment operator.
Of course, the example is contrived because foo doesn’t compile to C or C++ code anyway, it compiles to machine code, which doesn’t use return, or int, or whatever.