I want to create a variable 3 dimensional array in c++ that i can change and access any where in the program
this is what I want to do, I want to enter a string and then from there should the 3 dimenional array be be build.
If I enter a new string a new array should be build.
At the moment I have to specify the lenght of the array
this should be done automatically
the code i've got I think is static
My code sofar
char charset = "groen"; //I must be able to change this
int str_length = strlen(charset);
// I must be able to use this array through the program
// edit, re-initialize the array
for ( x = 0; x < str_length; x++)
for ( y = 0; y < str_length; y++)
for ( z = 0 ; z < str_length ; z++)
cubearr[x][y][z] = charset[i];
I want to make this dynamic and accessable all over in the program