Pointer comparison

后端 未结 2 931
礼貌的吻别
礼貌的吻别 2021-01-19 10:31

Do pointers in C and C++ support comparison operators (>, <, etc.) in standard?

I want to compare array positions to be precise.

2条回答
  •  情歌与酒
    2021-01-19 11:22

    Yes, they can be compared.

    For example, see "Relational Operators" in standards for further information, 6.5.8 in C99, and 5.9 in old draft of C++ (2006-11).

提交回复
热议问题