Re: getline and CR, LF, CR/LF, VS/Linux
- From: "Gene Bushuyev" <spam@xxxxxxxxxxxxx>
- Date: Sun, 10 Jul 2005 00:15:32 GMT
"Ian Semmel" <isemmel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:O27xtnNhFHA.2916@xxxxxxxxxxxxxxxxxxxxxxx
> What is the correct method for handling text files which may (or may not)
> have a CR character at the end of each line ?
>
> There seems to be a difference the windows/linux VS/gcc handle the
> situation.
>
>
> My program works OK under VS, but in linux it appears to read the first
> line then returns EOF ?
Windows, Mac, and Linux/Unix - all three have different EOL characters. The
STL streams work correctly on all platforms as long as you read the text
files in the format that corresponds to that platform. If you're writing in
one platform format and try reading in another, you are on your own. Either
process EOL yourself, or convert text files, for example, using dos2unix
(unix2dos) utils.
Gene
.
- Follow-Ups:
- Re: getline and CR, LF, CR/LF, VS/Linux
- From: Ian Semmel
- Re: getline and CR, LF, CR/LF, VS/Linux
- References:
- getline and CR, LF, CR/LF, VS/Linux
- From: Ian Semmel
- getline and CR, LF, CR/LF, VS/Linux
- Prev by Date: getline and CR, LF, CR/LF, VS/Linux
- Next by Date: Re: getline and CR, LF, CR/LF, VS/Linux
- Previous by thread: getline and CR, LF, CR/LF, VS/Linux
- Next by thread: Re: getline and CR, LF, CR/LF, VS/Linux
- Index(es):
Relevant Pages
|