This is a sort of psuedo code how post increment is implemented:
T * operator++ /* post increment */ ( T *& p ) { T * p_temp = p ; p = p + 1 ; return p_temp ; }
As I extract this, it works something like this:
1. create a temp pointer variable
2. increment the original pointer
3. return temp, that is for now the pointer value
4. evaluate expression
5. now we can use the incremented pointer value
Abonneren op:
Reacties posten (Atom)
Geen opmerkingen:
Een reactie posten