I have a file with hex numbers as follows:
00042980 00020000 00020000 00028000 00020008 00021000 01028000 00000000 00000000
In this same exact fashion.
How do I read this file in binary in C++?
You can use the std::hex manipulator:
#include <fstream>
#include <iostream>
using std::cout;
using std::hex;
using std::ifstream;
int main() {
ifstream input("file");
int data;
while(input >> hex >> data) {
cout << data << std::endl;
}
}