ifstream >> int stops working after one number

Hi,
I'm trying to read a text file containing hex numbers into an int array using ifstream.
for example, text file looks like this:
0000006f
ffffff22
0000014d
00000000

the following code reads the first number and then stops:
...
1
2
3
4
5
6
int i = 0;
int data[2048] = {0};

do {
   dataFile >> hex >> data[i++] ;
} while ( ! dataFile.eof() && i < 2048) ;


after reading 6f to data[0], the rest of the values are not read.
Any ideas ?
How else would I do it?
ffffff22 looks too large for a signed 32bit integer
Topic archived. No new replies allowed.