el error es: [Error] invalid types 'int[int]' for array subscript
Alguna idea de que sea?
Código:
#include <cstdlib> #include <iostream> #include <ctime> #include <stdio.h> using namespace std; bool serepita(int num,int numero[][9]) { int b,c; for (b=0;b<9;b++) {for(c=0;c<9;c++) {if (num==numero[b][c]) {return true; } else {return false; } } } } int main(int argc, char *argv[]) { int s[9][9]={1,1,0,0,1,0,0,1,0, 1,1,0,0,0,0,0,0,1, 0,1,1,1,0,1,1,0,0, 0,0,0,1,1,0,1,0,1 ,0,1,0,0,1,0,0,1,0, 1,0,1,0,1,1,0,0,0, 0,0,1,1,0,1,1,1,0, 1,0,0,0,0,0,0,1,1, 0,1,0,0,1,0,0,1,1},i,j; int az; int x,y,numero,elnumero; srand(time(NULL)); for (i=0; i<9; i++) { for(j=0; j<9; j++) { if(s[i][j]==1) { az=1+rand()%(9); s[i][j]=az; } } } for (i=0;i<9;i++) {for(j=0;j<9;j++) {elnumero=numero[i][j]; // Aqui el error while (serepita(elnumero,numero)) {s[i][j]=rand()%9; } } } for (i=0; i<9; i++) { for(j=0; j<9; j++) { if(s[i][j]==0) printf(" º º "); else printf( " º %d º ",s[i][j]); } cout<<"\n\n"; } system("PAUSE"); return EXIT_SUCCESS; }