[Solved] Receiving an “Error: expected an identifier” on C++ for “==”


if (f_in); std::ifstream == int NULL);

You could rewrite this as this:

if (f_in)
    ;
std::ifstream == int NULL);

And you can see that this doesn’t really make sense.

Maybe you meant:

if (!f_in) {
    fprintf(stderr, "Can't open input file in.list!\n");
    exit(1);
}

Or

if (f_in == NULL) {
    fprintf(stderr, "Can't open input file in.list!\n");
    exit(1);
}

1

solved Receiving an “Error: expected an identifier” on C++ for “==”