且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

sizeof(vector)的大小是多少?C ++

更新时间:2021-11-08 01:49:40

使用 vector :: size()方法: i<v.size().

sizeof 运算符在编译时返回对象或表达式的字节大小,这对于 std :: vector 是恒定的.

The sizeof operator returns the size in bytes of the object or expression at compile time, which is constant for a std::vector.