C++ vector size types

前端 未结 5 1839
醉话见心
醉话见心 2021-02-12 13:49

I just started learning C++ and have a question about vectors. The book I\'m reading states that if I want to extract the size of a vector of type double (for example), I should

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 14:11

    Java does not have unsigned integer types, so they have to go with int.

    Contrarily, C++ does and uses them where appropriate (where negative values are nonsensical), the canonical example being the length of something like an array.

提交回复
热议问题