Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

xdanillumx

3D arrays....proper initilization

This topic is 5404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to work with some three-dimensional arrays and I am not sure how to properly initialize them and then send them to a function...I am using MSVC++.net 2003 and I am programming in a win32 console app. I am able to work with 2D arrays just fine and I tried tweaking that method a little bit, but to no avail. I am just trying to make an array of arrays of strings then print them to the screen using a for loop inside of a function...thanks for any help... Dan...

Share this post


Link to post
Share on other sites
Advertisement
Here is a variation on what I am trying to do....note that I am just trying to initialize a small part of the array to see if I can get it working the fianl array dimensions that I want are [52] [5] [6]



char *cards[1][5] =
{
{

{"Stuff"},
{"Stuff"},
{"Stuff"},
{"Stuff"},
{"Stuff"},
},
};


I have tried a few other ways already that haven''t worked, any help is appreciated...please forgive any glaring errors if I have made them...

Dan...

Share this post


Link to post
Share on other sites
I would use std::string s, then it''s only a 2d array again, along with a host of other good things that happen when you use strings.

Share this post


Link to post
Share on other sites
A better representation of what I am looking for would be this



char *cards[2][5] =
{
{
{"stuff"},
{"stuff"},
{"stuff"},
{"stuff"},
{"stuff"},
},
{
{"stuff"},
{"stuff"},
{"stuff"},
{"stuff"},
{"stuff"},
},
};






and I am pretty sure that this would need to be in a 3D array...am I wrong on this...or would std::string really eliminate this need for a 3D array?

Dan...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!