Skip to main content
GameDev.net gamedev.net
🔒 Locked

Using an array in a function.

Started by Dark_Psi Apr 24, 2003 at 4:25 PM 1 replies 400+ views
Original Post
Dark_Psi
Dark_Psi
Hi, I''m having a simple problem : I want to use a double dimension array in a function but it doesnt work.
   
unsigned char MAP[][];
int Pos;

int Func(int x,int y,char MAP)
{
  Pos = MAP[x][y];
}
  
well can anyone help me ? I''ve heard somewhere that I need to use double pointers but I don''t know how, please help
** Dark Warrior Psi **
Basiror
Basiror

unsigned char map[xdimension][ydimension];
int pos;
int func(int x,int y,int ydimension, unsigned char *map)
{
pos=(int)map[x*ydimension +y-1];
}

works with my raw heightmaps
http://www.8ung.at/basiror/theironcross.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.