... - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

...

Gregry2Gregry2 Posts: 607Member
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

  • stoberstober Posts: 9,765Member ✭✭✭
    [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.