c++vector默认大小
时间: 2023-08-17 16:12:30 浏览: 133
回答: 在C++中,vector的默认大小是0。当你使用默认构造函数创建一个vector对象时,它不包含任何元素,大小为0。\[3\]
#### 引用[.reference_title]
- *1* *2* [C++ vector数组初始化大小的方法](https://blog.csdn.net/weixin_44718636/article/details/105357983)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [vector](https://blog.csdn.net/SlowIsFastLemon/article/details/103943102)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文