...

I'm working in win32...

I read an entire file into a buffer, and perform line by line parsing on the buffer in my program. Now the question is what should I check for to know that we have a newline...
, or
...I heard windows makes it so
can be printed out as
, but does it do the reverse when you read it, like it turns the
into
(don't know why it would, but I'm not sure)?

Thanx
{2}rIng

Comments

  • [b][red]This message was edited by stober at 2007-3-18 2:57:36[/red][/b][hr]
    : I'm working in win32...
    :
    : I read an entire file into a buffer, and perform line by line parsing on the buffer in my program. Now the question is what should I check for to know that we have a newline...
    , or
    ...I heard windows makes it so
    can be printed out as
    , but does it do the reverse when you read it, like it turns the
    into
    (don't know why it would, but I'm not sure)?
    :
    : Thanx
    : {2}rIng
    :

    yes, when the file is opened for read in text mode MS-Windows os replaces the "
    " that is physically written to the file with "
    " when the line is read by fgets() function. Why? because the c/c++ standards say so and it makes the program more portable between operating systems.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion