Advertisement

Array of pointers to arrays

Started by January 17, 2003 02:53 AM
-1 comments, last by yckx 21 years, 10 months ago
I've got a handful of arrays holding map data, essentially for a tile-based map. I need to be able to call each array successively from several functions to process them, so I thought I'd have an array of pointers to the map arrays Is this how I would do this?
    
char map01 = {...};
char map02 = {...};
//

char mapN = {...};

char* mapArray = {map01, map02, ..., mapN};
    
How would I go about iterating through the maps and their elements. Can I just do mapArray[n][m], or do I need to do it through pointers somehow? I can't test this right now, and I somehow don't think that will work, so I'm asking you guys. Thanks yckx [edited by - yckx on January 17, 2003 4:09:30 AM]

This topic is closed to new replies.

Advertisement