Hello i would like to store a matrix into a file here's the code I made
void fichier_print(grid_t grille, int n){
int i,j;
FILE *f_solution;
f_solution=fopen("solution.txt","wb");
if( f_solution == NULL )
{
printf("Le fichier est corronpu");
exit(1);
}
for (i=0; i<n; i++){
for (j=0; j<n; j++){
fprintf(f_solution,"%c\n",grille.data[i][j]);
}
printf("|\n");
}
printf("\n");
fclose(f_solution);
}
Here grille.data is the matrix that i want to save in a file .
The thing is that when i run the code nothing appears no .txt ( I made sure that I was in the correct directory before saying this ) .
Is there anyone with a clue ? Thanks