I want to open a file in decimal mode.
Exemple:
ifstream file (ds->GetLocation(), ios::in|ios::binary); // how to open in decimal mode?
char ch;
if(file.is_open())
{
while (!file.eof())
{
file.get(ch);
double num = ch;
cout << num << endl;
}
file.close();
}
When I open in binary mode the output is:
0
0
0
2
0
0
0
2
0
0
0
2
0
0
0
4
0
0
0
4
0
0
0
4
0
0
0
4
0
0
0
6
0
0
0
6
0
0
0
6
0
0
0
6
0
0
0
0
But I don't want the zero. I just want:
2
2
2
2
4
4
4
4
6
6
6
6
I can obtain these values in terminal with:
$ od -D filename
So, I want this result by reading the file in C++.