小编gag*_*ou7的帖子

C standard regarding pointer arithmetic outside arrays

I read lot of things about pointer arithmetic and undefined behavior (link, link, link, link, link). It always ends up to the same conclusion: Pointer arithmetic is well defined only on array type and between array[0] and array[array_size+1] (one element past the end is valid with regard to the C standard).

My question is: Does it means that when the compiler sees a pointer arithmetic not related to any array (undefined behavior), it could …

c math standards pointers undefined-behavior

4
推荐指数
1
解决办法
99
查看次数

标签 统计

c ×1

math ×1

pointers ×1

standards ×1

undefined-behavior ×1