This code works perfectly, but due to performance, I want to make the write function one call.
The following code doesn't work. It causes my columns to be off (image slanting right).Code:int i=0,k=0; for(i;i<rows;i++) for(k=0;k<cols;k++) fwrite(&matrix[i][k],sizeof(float),1,stdout); }
Any ideas where I'm going wrong?Code:if(fwrite(matrix,sizeof(float),rows*cols,stdout)<rows*cols) { perror("error"); exit(1); }
Thanks in advance