What is this code doing? (size_t)-1

前端 未结 3 1715
深忆病人
深忆病人 2021-02-14 08:12

Can someone explain what happens when size_t, or any other type identifier, is wrapped in parentheses. I know it is the old typecast syntax but in this context I don\'t follow w

3条回答
  •  感情败类
    2021-02-14 08:47

    (size_t)-1 is in fact the equivalent of size_t(-1)

    See also the following question c cast syntax styles

提交回复
热议问题