I have to write some results in an xls file, but I need to create a single file that contains everything, so far I create one file for each iteration, but I do not know how to make it write one result followed by another.
this is my code (corrected),
void writeXLS(int numCell,int dmax,int ite,float **x){
char it [5];
itoa(ite,it, 10);
char *name = concat("resul",it);
char *arc = concat(nombre,".xls");
FILE *Resul;
Resul=fopen(arc,"w");
for(int j=0;j<numCell;j++){
for(int k=0;k<dmax;k++){
fprintf(Resul,"%.3g\t",x[0][j*dmax+k]);
}
fprintf(Resul,"\n");
}
fclose(Resul);
}
I can´t open the file outside the function .. is a huge project and I open others files for write and read.
I call writeXLS() in each iteration and need to write down in XLS file.