you can use vector<user_defined_type>, but you should offer a default constructor,
e.g.:
#include <iostream>
#include <vector>
using namespace std;
class spin_cite
{
public:
spin_cite() {}
int val;
int x;
int y;
int z;
bool check;
spin_cite(int X, int Y, int Z, int VAL, bool CHECK)
{
x = X;
y = Y;
z = Z;
val = VAL;
check = CHECK;
}
};
using elem = vector<spin_cite>;
using elem_arr = vector<elem>;
vector<elem_arr> a;
int main()
{
cout << "Set dims like: x,y,z" << endl;
short x = 0, y = 0, z = 0;
((cin >> x).ignore(1, ',') >> y).ignore(1, ',') >> z;
cout << "alloc a 3d array: " << x << ',' << y << ',' << z << endl;
for (short ix = 0; ix < x; ++ix)
{
elem_arr ea(y);
for (int iy = 0; iy < y; ++iy)
{
elem e(z);
for (int iz = 0; iz < z; ++iz)
{
e[iz].x = 1;
e[iz].y = 1;
e[iz].z = 1;
e[iz].val = 1;
e[iz].check = 1;
}
ea[iy] = std::move(e);
}
a.push_back(std::move(ea));
}
cout << "a.size == " << a.size()
<< ", a[0].size == " << a[0].size()
<< ", a[0][0].size== " << a[0][0].size()
<< endl;
return 0;
}