1

When I try to run my ./resize 4 small.bmp large.bmp I get this:

jharvard@appliance (~/Dropbox/pset5/bmp): ./resize 4 small.bmp large.bmp
Could not open 4.

Check50 seems to say that I have extraneous printf output, but that it's performing the resizing correctly (except for 1x):

jharvard@appliance (~/Dropbox/pset5/bmp): check50 2014/x/pset5/resize bmp.h resize.c
Checking........................................................................:) resize.c and bmp.h exist
:) resize.c compiles
:( doesn't resize 1x1-pixel BMP when n is 1
   \ expected an exit code of 0, not output of "Could not open 1.\n"
:( resizes 1x1-pixel BMP to 2x2 correctly when n is 2
   \ expected an exit code of 0, not output of "Could not open 2.\n"
:( resizes 1x1-pixel BMP to 3x3 correctly when n is 3
   \ expected an exit code of 0, not output of "Could not open 3.\n"
:( resizes 1x1-pixel BMP to 4x4 correctly when n is 4
   \ expected an exit code of 0, not output of "Could not open 4.\n"

Could someone help me understand what type of problems I should be looking for?

Thank you.

2
  • Thanks for asking this question! I was doing something similar! :) – timbram Sep 7 '15 at 2:45
  • Check for any silly printf statements that you may have implemented before. Time to start using GDB ;) – user10046 Oct 28 '15 at 19:49
3

Apparently, you're trying to open a file using the factor (n) — the number that's provided as a command-line argument. Rather, you should open the input file using the file name that should be provided as the first argument after that factor!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .