是否可以使用在<array>
标头中声明的数组容器声明可变长度数组,如果可以,如何在(VS)C ++中声明它?
std::array
is a fixed-length array, and its length must be known at compile-time as it is a parameter of the template, and thus must be a constant value.
You want std::vector
in the <vector>
header. It is a variable-length array, its length is specified at run-time , and it can be resized dynamically.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.