static_cast(foo) vs. (int)foo

前端 未结 3 1393
粉色の甜心
粉色の甜心 2021-02-01 05:02

Could somebody please elaborate on the differences?

3条回答
  •  终归单人心
    2021-02-01 05:34

    (int) foo compares most to c++ reinterpret_cast, i.e. no checks on the validity of the cast.

提交回复
热议问题