如果我在32位字机上有代码:
struct myStruct {
//structure that occupies six bytes
uint32_t value1;
uint16_t value2;
} *p = (myStruct *)0x10;
p ++相等多少? 0x14的?为0x11?还是0x16?
答案 0 :(得分:2)
它以sizeof(myStruct)递增。指针算术以指向的大小为单位。 for char *,p ++; p = p + sizeof(char);