How can I get the file size of a file if the file contains EOF? I tried
but it's stopping at the first EOF (0 byte) it finds.Code:in_file.open(fname.c_str(), ios::binary); if (in_file == NULL) return -1; in_file.seekg(0, ios::end); fsize = in_file.tellg(); in_file.seekg(0, ios::beg); tmp_buffer = new char[fsize]; in_file.get(tmp_buffer, fsize, '\0'); in_file.close();