- 博客(1)
- 资源 (2)
- 收藏
- 关注
原创 C语言技术进阶之 指针相减的含义
C语言技术进阶之 指针相减的含义 int main() { int iA[4]; short *p1 = &iA[0]; short *p2 = &iA[1]; printf("Pointer Diff = %lu\n",p2-p1); return 0; } 上述程序运行结果:Pointer Diff = 2 (代表两个USHORT类型) 不是 4 因为指...
2019-10-21 22:42:28 191
C语言技术进阶之 指针相减的含义
int main()
{
int iA[4];
short *p1 = &iA;[0];
short *p2 = &iA;[1];
printf("Pointer Diff = %lu\n",p2-p1);
return 0;
}
上述程序运行结果:Pointer Diff = 2 (代表两个USHORT类型)
不是4.
因为指针相减含义是多少个该类型的单位。不是纯字节数。
2019-10-20
CascadiaCode-Regular-VTT (1).ttf
微软的编程 等宽字体。在终端使用非常好。
This is a fun, new monospaced font that includes programming
ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
2019-10-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人