Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing dynamic declared multi-arrays :)

Status
Not open for further replies.

jdarvwill

Technical User
May 22, 2002
12
0
0
CA
hi, i created a dynamic [numPlayers][3] array at run time depending on the number of players. Problem is trying to pass this array through functions.
I read u need to know at least the column value which i do, but when i try to pass it i get an error. any help is appreciated
here is the function declaration, definition and call.

void addValues(int,int[][3]);

void addValues(int numPlayers,int gameArray[][3])

addValues(numPlayers,gameArray[][3]);

thanks :)
 
In class, they always told us to solve this kind of problems with pointers. I never really got that, but I think you could pass this like:

void addValues(int,**int);

void addValues(int numPlayers,**int gameArray)

addValues(numPlayers,&gameArray);



--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top