// Copies a BMP file ​



include "bmp.h"

​ int main(int argc, char *argv[]) { // ensure proper usage if (argc != 3) { printf("Usage: copy infile outfile\n"); return 1; } ​ // remember filenames char *infile = argv[1]; char *outfile = argv[2]; ​ // open input file FILE *inptr = fopen(infile, "r"); if (inptr == NULL) { printf("Could not open %s.\n", infile); return 2; } ​ // open output file

  • Most of the code is missing (the part between fread and fwrite, the only part you are meant to change, would be most interesting). Also, on StackExchange, in the Question/Answer editors, you can select all your code and hit the {} button with the mouse or Ctrl+K on the keyboard to indent the code, which is StackExchange style markdown for a code block. – Blauelf Nov 11 '19 at 15:22
  • Also, this is called a naked code drop - code with little or no explanation beyond the title, and is against forum rules. Please edit your question and add context. What appears to be the problem? What do you think is going on? What have you done to identify the issue? What output are you getting, in detail? – Cliff B Nov 11 '19 at 21:04
  • Thank you I got it. I realized where I did wrong. – BMavhungu Nov 12 '19 at 9:28

You must log in to answer this question.

Browse other questions tagged .