I have a C++ learning demo here:
char c = \'M\'; short s = 10; long l = 1002; char * cptr = &c; short * sptr = &s; long * lptr = &l; cout <&
You re having undefined behavior in lines 18, 19, 20. Cause of the result of executing the line will be different depending on whether ptr or ++ptr is evaluated first.
18, 19, 20
ptr
++ptr