怎么从文件中读取2进制数
想读取TXT文档中的2进制数据,但是这样读进去是10进制数啊
string file;
cout < < "Please enter file to analyze: ";
cin> > file;
ifstream infile(file.c_str());
if(!infile)
{cerr < < "error:unable to open input file: " < <ifile < <endl;
}
unsigned int buffer[1518];
int i=0;
while (infile> > buffer[i])
{cout < <buffer[i] < < " ";
i++;
}
[解决办法]
ifstream infile(file.c_str());
================================
好像要指定标志的,
[解决办法]
当string读入,然后atoi