std::ifstream ifs(path, std::ifstream::ate | std::ifstream::binary); unsigned int size = ifs.tellg(); ifs.close(); Run Code Online (Sandbox Code Playgroud) 大多数时候,在 C++ 中,在哪里/何时调用相关ifs.good()?就我而言,创建流后还是调用后更好tellg()?