Im passing a matrix as argument in a function call saveFile
void saveFile(char raw[],char inf[],int r, int c, int m[r][c]){
FILE *save_raw,*save_inf;
int i,j;
save_raw = fopen(raw,"w");
save_inf = fopen(inf,"w");
for(i=0;i<r;i++){
for(j=0;j<c;j++){
fprintf(save_raw,"%d ",m[i][j]);
}
fprintf(save_raw,"\n");
}
And Im calling the fuction like this
saveFile(image_name_extension,image_name_info,rows,columns,raw_n);
The output of raw_n before calling the function is:
0 132 132 246 237
0 223 132 246 237
0 132 132 246 237
230 132 132 246 237
0 166 142 246 248
but for some reason I dont now the output of raw_n inside the saveFile function is:
0 132 132 246 237
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
I'ts not a logical problem, anybody can help me? Thanks.
raw_n is filled like this
for(i=0;i<rows;i++){
for(j=0;j<columns;j++){
raw_n[i][j] = MAX_PIXEL - raw[i][j];
}
}