Home > Software design >  The specified file could not be found when i run a file.exe
The specified file could not be found when i run a file.exe

Time:11-17

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 ?

CodePudding user response:

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
  • Related