You shouldn't name a variable like a type. You are shadowing std::array
. You should rename the variable and use std::array
instead of C-arrays:
#include <array>
#include <string>
#include <vector>
using StrArr2D = std::array<std::array<std::string, 16>, 16>;
int main() {
StrArr2D arr;
std::vector<StrArr2D> vec;
vec.push_back(arr);
}
You can keep the variable name array
if you avoid using namespace std;
and use full qualified names.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…