S
szclark
Hello, I am trying to extract information from a file I have so that I
can answer some questions on it, the problem I'm having is that it is
returning back mostly gibberish and I really don't know what I can do
to change it into proper text. Thre is a section at the bottom of my
output that is in proper english but I don't know about the rest. The
file I am reading is a.HDR file and this is the code:
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
void ReadFile()
{
ifstream fin("METSAT.HDR", ios::binary)
cout << "Contents of the file...\n";
char ch;
while(fin.get(ch))
cout << ch;
}
int main()
{
ReadFile();
return 0;
}
The output is all ASCII letters, so I was thinking of trying to find
out the ASCII values and changing them into their binary equivalent
which should help with some of the qestions I am needing to answer.
Any help would be greatly appreciated.
Stu.
can answer some questions on it, the problem I'm having is that it is
returning back mostly gibberish and I really don't know what I can do
to change it into proper text. Thre is a section at the bottom of my
output that is in proper english but I don't know about the rest. The
file I am reading is a.HDR file and this is the code:
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
void ReadFile()
{
ifstream fin("METSAT.HDR", ios::binary)
cout << "Contents of the file...\n";
char ch;
while(fin.get(ch))
cout << ch;
}
int main()
{
ReadFile();
return 0;
}
The output is all ASCII letters, so I was thinking of trying to find
out the ASCII values and changing them into their binary equivalent
which should help with some of the qestions I am needing to answer.
Any help would be greatly appreciated.
Stu.