quick array question

Started by
3 comments, last by Jedite 19 years, 8 months ago
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?
Quote:Original post by BosskIn Soviet Russia, you STFU WITH THOSE LAME JOKES!
Advertisement
Second

Kuphryn
Cheers :)
Quote:Original post by BosskIn Soviet Russia, you STFU WITH THOSE LAME JOKES!
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.
Ra
depends on how you go through it... Mostly i would go y x.... easier for reading.. y x as in int array [y][x];


This topic is closed to new replies.

Advertisement