A few answers here (deleted after this answer was posted) explicitly meant bytes *:
int a[10]; byte * pA2 = (byte*)&a[2]; byte * pA1 = (byte*)&a[1]; int sz1 = &a[2] - &a[1]; int sz2 = pA2 - pA1; CString msg; msg.Format("int * %d, byte * %d\n", sz1, sz2); OutputDebugString(msg);
:
int * 1, byte * 4
Two addresses, but depending on the variable declaration, addresses are stored, the difference between them can be 1 or 4.
sean e
source share