Computer Science Canada Creating Multidimensional Array with a Nonconstant value |
Author: | one [ Tue Jan 20, 2009 9:25 pm ] | ||||||
Post subject: | Creating Multidimensional Array with a Nonconstant value | ||||||
Variable inputted- a The array is of integer type and 3 of the dimensions are known Eg:
How would you do that? For 2d array its like this:
So what would you do for 4d? Thanks Mod Edit: Remember to use syntax tags! Thanks
|
Author: | OneOffDriveByPoster [ Tue Jan 20, 2009 11:09 pm ] | ||
Post subject: | Re: Creating Multidimensional Array with a Nonconstant value | ||
If you understand the following declaration, then see what you can do with it:
|
Author: | md [ Wed Jan 21, 2009 8:26 pm ] |
Post subject: | RE:Creating Multidimensional Array with a Nonconstant value |
you could use a typedef - always fun... |
Author: | wtd [ Sat Jan 24, 2009 3:03 pm ] | ||
Post subject: | RE:Creating Multidimensional Array with a Nonconstant value | ||
You should be creating your own wrapper class so all of this munging about in three dimensional arrays is hidden from the main logic of your program. A hint:
|