I need to display a board who have this structure
only with O - | chars
Have this error
main.c:17:29: error: expected primary-expression before ‘]’ token desplegar_tablero(&tablero[][],fil,col);
(still not complete the algorithm but i'm working in it)
int main(int argc, char **argv){
if (argc != 3){
fprintf(stderr, "Ejecutar como ./prog N_filas N_columnas.\n");
exit(EXIT_FAILURE);
}
int fil = 2*(atoi(argv[1]))-1;
int col = 2*(atoi(argv[2]))-1;
char tablero[fil][col];
desplegar_tablero(&tablero[][],fil,col);
}
void desplegar_tablero(char tab[][], int f, int c){
for (int i = 1; i<= f; ++f){
for (int j = 1; j <=c; ++c){
//Si fila es impar
if (i%2 == 1){
//Columna Impar
if (j%2 == 1){
// ASCII 79 = O
tab[i][j]= 79;
printf(" %u ",&tab[i][j]);
}
//Columna par
else{
// ASCII 196 = -
tab[i][j] = 196;
printf(" %u ",&tab[i][j]);
}
}
// Si fila par
else{
//Columna impar
if (j%2==1){
// ASCII 179 = |
tab[i][j]= 179;
printf(" %u ",&tab[i][j]);
}
//Columna par
else{
// ASCII 32 = espacio
tab[i][j] = 32;
printf(" %u ",&tab[i][j]);
}
}
printf("\n");
}
}
}