Hi,
Im trying to call a function within a function but the 2nd function isnt returning anything.
The code compiles fine.
Code:
void playerMove(char playerInput,int playerRow,int playerCol,int theGrid[][10])
{
getPlayerPos(playerRow,playerCol,theGrid);
}
its the function getPlayerPos that isnt returning any values.but if I call the getPlayerPos outside of playerMove it works.
Code:
int getPlayerPos(int& playerRow,int &playerCol,int theGrid[][10])
{
for(int row=0;row<10;row++){
for(int col=0;col<10;col++){
if(theGrid[row][col]==1){
playerRow=row;
playerCol=col;
return playerRow,playerCol;
}
}
}
}
Any ideas?