Pass a pointer to a 2d array to BMax

BlitzMax Forums/BlitzMax Programming/Pass a pointer to a 2d array to BMax

I made a grid based game using C(++) and BlitzMax, where there was a C 2d array for the game's grid. Rather than fiddle with pointers, I simply made a C function that took x and y as parameters, and returned that element of the array.

For example char getCell(int x, int y, char array) {return array[x][y];}

Not the fastest or most elegant solution, but I found it more convienent for my simple game (and didn't have any performance issues with it) than dealing with pointer headaches. Depends whether you want the speed/must use pointers, or looking for a quick-fix ;)