Hi,
Im trying to call a function within a function but the 2nd function isnt returning anything.
The code compiles fine.
its the function getPlayerPos that isnt returning any values.but if I call the getPlayerPos outside of playerMove it works.Code:void playerMove(char playerInput,int playerRow,int playerCol,int theGrid[][10]) { getPlayerPos(playerRow,playerCol,theGrid); }
Any ideas?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; } } } }



LinkBack URL
About LinkBacks



