(I assume you mean "1" on the last line, not "p")
Pointer arithmetic in C and C ++ is a logical complement, not a numeric addition. Adding one to the pointer means "create a pointer to the object that goes into memory right after that", which means that the compiler automatically scales what you are increasing the pointer to the size of the object that it is pointed at. This prevents you from having a pointer to the middle of the object, or an invalid pointer, or both.
templatetypedef
source share