c++ - Compare const and non-const pointers? -
compare const , non-const pointers. comparing legal? special care such comparison. thanks.
a pointer t
can implicitly converted const pointer t
; similarly, pointer t
can implicitly converted pointer const t
. compiler either of conversions, or both, needed when seek compare pointer const pointer. there's nil there that's more risky comparing 2 non-const pointers or 2 const pointers.
c++ pointers
No comments:
Post a Comment