Jump to content
  • Advertisement
Sign in to follow this  

quick array question

This topic is 5022 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

Ive never really thought about it but when you declare a 2d array, which number is for the vertical size and which is for the horizontal e.g. does int array[5}[2]; create this xxxxx xxxxx or this xx xx xx xx xx I dont think it really matters as long as you always refere the same way but I was wondering if anyone knows of a situation where it would matter?

Share this post


Link to post
Share on other sites
Advertisement
There isn't anywhere it would matter unless you're doing something extremely sick like going out of bounds on the second dimension to access another first dimension. There's really no way to visualize it unless you say the first dimension is X, the second is Y... in memory they're just a bunch of contiguous bytes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!