Hi again!
This is my code.
My problem is this: s_c1 are integer numbers. I put the "break" because they may be the same number for differents "k" values, and without it, my matrix array will fail (because of the dimension). So, for each "i" and "j", and for all "k", if the condicional is satisfied, only one "5" can be recorded; if not, only one "0" have to be recorded.Code:for( i = 0; i < DIM; i++){ for( j = 0; j < DIM; j++){ for ( k = 1; k <= cont; k++){ if( i == s_c1[k][0] && j == s_c1[k][1] ) { fprintf( fp[1], " %d ",5); break; } else { fprintf (fp[1], " %d ",0); break; } } } fprintf(fp[1],"\n"); }
But... altough I have 15 s_c1, my recorded file only has ONE "5", and it has to have fiveteen. ¿Is the "break" doing something wrong there?
Thanks for reading!