I have a text file which has one hex value in each line. Something like
80000000
08000000
0a000000
Now i am writing a c++ code to read this directly. SOmething like
fstream f(filename, ios::in);
while(!f.eof)
{
int x;
char ch;
f>>std::hex>>x>>ch; // The intention of having ch is to read the '
'
}
Now this is not working as expected. While some of the numbers are getting populated properly, the ch logic is flawed. Can anybody tell me the right way of doing it.
I basicaly need to populate an array with the int equivalent.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…