iterating in a array in C

前端 未结 4 1825
南笙
南笙 2020-12-11 12:06

Hey I have something of this type

eph_t *a;

The type is eph_t as you can see. Its an array in C but I do not know the size of the array nor

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 13:02

    If you do not know the size of the array then it is unsafe to iterate over it. Any time that you attempt to read elements beyond the last one you will get undefined behaviour. There is nothing safe you can do unless you know the size of the array.

提交回复
热议问题