void checkMark(char array, int userInput){
int c=1;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
if(userInput==c){
array[i][j]='X'; //error here
}
c++;
}
}
}
I am making a tic tac toe game. This function is to switch out the number with an 'X' in the array, but it keeps giving me an error to do with the subscripts with the array.
In function `void checkMark(char*, int)':
invalid types `char[int]' for array subscript
[Build Error] [main.o] Error 1
Can I not use i and j as the subscripts in a function? It works perfectly fine if I put it in the main code.