Mail Archives: djgpp/1998/08/26/18:18:05
From: | Endlisnis <s257m AT unb DOT ca>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Problem with files reading
|
Date: | Tue, 25 Aug 1998 12:34:44 -0300
|
Organization: | NBTel Internet
|
Lines: | 29
|
Message-ID: | <35E2D993.6C840727@unb.ca>
|
References: | <35E1D68E DOT 69B6BC24 AT infonie DOT be>
|
NNTP-Posting-Host: | fctnts10c69.nbnet.nb.ca
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Crousto wrote:
> Hi all,
> I've got a little problem with reading files with the file.get function.
> I'd like to disable the carriage returns, form feed,... for reading a
> list of single-byte datas. The problem is that if I use file.get on a
> file like this : 0D FF , I'll get FF because 0D is an escape character,
> even with file.unsetf(ios::skipws). But I need to get only 0D, not as
> the escape char but as the 13 integer. Anyone got a solution? Thanks in
> advance...
Yes, I have a solution. When you are opening your file, do something
like this:
fstream File;
File.open("whatever.dat", ios::in | ios::binary);
Just add "| ios::binary" to the end of the line in-which you open the
file.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -