I am trying to create a 3D vector and then populate it with values. Firstly I want to create a 3D vector of size 100 with all initial values set to zero. I know that to do this in the 1D case the code would read as follows:
vector<float> vec (100, 0)
I want to do the same thing with a 3D vector. How would the code look? I'm guessing something like
vector<vector<vector<float> > > vec (100,0);
Next, I want to assign certain entries of the vector. In the 1D case I would write something like:
vec.at(3) = 5.336
How do I index a 3D vector like this?