C++ 种 failed open file 'xxx' with mode ios::in

idx_t
get_num_reads(const char* candidates_file)
{
    ifstream in;
    open_fstream(in, candidates_file, ios::in);
    ExtensionCandidate ec;
    int max_id = -1;
    while (in >> ec)
    {
        max_id = std::max(ec.qid, max_id);
        max_id = std::max(ec.sid, max_id);
    }
    close_fstream(in);
    return max_id + 1;
}

这个函数要怎么改呢?

文件名不合法,没有权限,或者无法打开(被别的程序锁定了),具体你调试下,看文件名。