开发者

std::vector<unsigned short> somehow contains numbers > 300?

I have a std::vector<unsigned short> that somehow contains numbers that are greater than 300.

unsigned short usually only permits 0 to 255, nowhere in开发者_如何学编程 the program attempts to add numbers that large and presumably attempts should fail.

How might this have occurred?

edit: Sorry about this, it's not much of a useful question, seems I had the usigned short range wrong.


unsigned short usually only permits 0 to 255

This is incorrect; unsigned short must have a range at least 0 to 65,535 (216 - 1).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜