0

When I use this

comparer.exe <test_comparer24_1>.bmp <test_comparer24_2>.bmp

in cmd, this error show up

The specified file could not be found

even thought I have the bmp files in the same folder. This is the part of code:

int main(int argc, char *argv[]) {
    if (argc != 3) {
        fprintf(stderr, "Use the format: %s <filename1>.bmp <filename2>.bmp\n", argv[0]);
        return -1;
    }

    return BMPComparer(argv[1], argv[2]);
}

any ideas to help me figure this out ?

3
  • It looke like the program is expecting you to enter the filenames without the .bmp extension, and you definitely don't need the angle brackets. Try comparer.exe test_comparer24_1 test_comparer24_2 instead
    – r3mainer
    Commented Nov 15, 2022 at 20:52
  • i tried that and it give me another error of File dosen't exist Commented Nov 15, 2022 at 21:21
  • can you add a function definition for BMPComparer? Commented Nov 15, 2022 at 23:33

1 Answer 1

0

The < and > characters are likely included in the help text to indicate that you should replace the contents.

The characters < and > have a special function on most shells and are called redirections.

Please try your command without the < and > characters:

comparer.exe test_comparer24_1.bmp test_comparer24_2.bmp

Not the answer you're looking for? Browse other questions tagged or ask your own question.