从c ++中读取二进制文件

时间:2014-04-09 19:18:54

标签: c++ file binary

在C ++中,当我尝试从二进制文件中读取int值时,它给出了0z到无穷大,我知道我不应该从二进制文件中读取这样的内容。但我想知道它为什么打印0z?

test.open("grade.dat", ios::in);
int num;
while (!test.eof())
{
    test >> num;
    cout << num << endl;
} 

0 个答案:

没有答案