C++指针加整数、两个指针相减的问题

考虑以下问题: c++ 1     char a[20];spa 2     int *ptr = (int *)a;指针 3     ptr++;ast 第3句ptr++实际为ptr右移一个int空间(即4个字节)的距离,此时ptr指向a[4]。static 若第3句改成co int *p = ptr + 2; cas 则p指向a[8]void 这里说明当指针加整数时,指针向后偏移的距离看的是声
相关文章
相关标签/搜索