Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <iostream>
#include <vector>
typedef std::vector<int> D1IntVec;
typedef std::vector<D1IntVec> D2IntVec;
typedef std::vector<D2IntVec> D3IntVec;
int main()
{
int xDim = 0;
int yDim = 0;
int zDim = 0;
while (xDim == 0 || yDim == 0 || zDim == 0)
{
std::cout << "Input the non-zero dimensions";
std::cout << "separated by spaces (e.g. 10 20 30):" << std::endl;
std::cin >> xDim >> yDim >> zDim;
}
D3IntVec d3Array(xDim, D2IntVec(yDim, D1IntVec(zDim)));
std::cout << "\nDimensions of array are: ";
std::cout << d3Array.size() << "x";
std::cout << d3Array[0].size() << "x";
std::cout << d3Array[0][0].size() << std::endl;
std::cout << "Default value is: " << d3Array[0][0][0] << std::endl;
}