string ***dat_array;
int t;
dat_array = new string **[t];
for (i=0; i<t; i++) {
dat_array[i] = new string *[3];
for (j=0; j<5; j++)
dat_array[i][j] = new string [5];
}
// dat_array = new string **[t];
for (i=0; i<t; i++)
for (j=0; j<3; j++)
for (k=0; k<5; k++)
dat_array[i][j][k] = string("Hello Everybody!");
@@@@@@@@@@@@@@@ @@@@@@
Is this the proper way to initialize a dynamically defined triple
string array "dat_array[t][3][5]"? I know a priori the last two
dimensions. I get the fist one, t , later in the program.
Thank you.
sherman
int t;
dat_array = new string **[t];
for (i=0; i<t; i++) {
dat_array[i] = new string *[3];
for (j=0; j<5; j++)
dat_array[i][j] = new string [5];
}
// dat_array = new string **[t];
for (i=0; i<t; i++)
for (j=0; j<3; j++)
for (k=0; k<5; k++)
dat_array[i][j][k] = string("Hello Everybody!");
@@@@@@@@@@@@@@@ @@@@@@
Is this the proper way to initialize a dynamically defined triple
string array "dat_array[t][3][5]"? I know a priori the last two
dimensions. I get the fist one, t , later in the program.
Thank you.
sherman
Comment