not able to save an image file using c?
问题 I tried to clone a bmp image into another bmp image but the final image would not open. #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <process.h> void readBMP(char* filename) { int i; FILE* f = fopen(filename, "rb"); FILE* f1= fopen("save.bmp", "wb"); if (!f) { printf("Could not read file!\n"); exit(0); } unsigned char info[54]; fread(info, sizeof(unsigned char), 54, f); int width = *(int*)&info[18]; int height = *(int*)&info[22]; printf("%d %d\n", width, height); fwrite