|
From: Alan T. <ala...@3n...> - 2001-08-02 01:21:08
|
Lorenzo,
I get exactly the same results from your code and mine. It =
still does not appear to be right. I don`t understand. A character =
occupies a byte, so I should be seeing each individual byte.
=
Alan
From: "Lorenzo" <co...@in...>
To: <dev...@li...>
Subject: Re: [Dev-C++] reading bytes
Date: Wed, 1 Aug 2001 11:27:45 +0200
Reply-To: dev...@li...
I have try this code:
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
char c;
int byte_no =3D 0;
ifstream in("test.xls", ios::in | ios::binary);
if (!in.is_open())
{
cerr << "error open file" << endl;
return 1;
}
while (in.get(c))
{
if ((byte_no >=3D 0) && (byte_no <=3D 7))
cout << endl << "byte " << byte_no << " is " <<
(short)(unsigned char)c << endl;
byte_no++;
}
in.close();
return 0;
}
and display the exact value of the excel file, try again !
-------------------------------------------------------------------------=
---
|