Pointers & Multi-Dimensional Arrays
Hey all. I have a function that draws out a map. The map is stored in a multi-dimensional array such as Tiles[200][200]. My question is, how can I access that array with a pointer? Better yet, would it be more efficient to retrieve the information in a different way?
Thanks,
Well, if all of the 200x200 items are adjacent in memory you can move through it with a pointer. I think it would be better to make it a single dimensional 40000 element array in memory though, then move through it like this:
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
![Resist Windows XP''s Invasive Production Activation Technology!](http://www.crosswinds.net/~druidgames/resist.jpg)
http://www.gdarchive.net/druidgames/
|
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
![Resist Windows XP''s Invasive Production Activation Technology!](http://www.crosswinds.net/~druidgames/resist.jpg)
http://www.gdarchive.net/druidgames/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement