I implement a template pointer wrapper similar to functiontiy to boost::shared_ptr .
I have a pointer to an integer ptrInt .
What I want to do: The integer increment ptrInt points to.
My initial code was as follows: *ptrInt ++; , although I also tried the same with (*ptrInt) ++;
Apparently, however, this does not seem to do what I expected from him. In the end, I started working with *ptrInt += 1; but I ask myself:
- What exactly does
*ptrInt ++; ? - Is there a more elegant solution for using
*ptrInt += 1; ?
c ++ syntax pointers
Klitschko
source share