Carriage Return and New Line - Are the both necessary? - VxWorks

This is a discussion on Carriage Return and New Line - Are the both necessary? - VxWorks ; Hi, I'm trying to learn whether it's necessary to say: printf("something\n\r"); or whether it's sufficient to just say: printf("something\n"); /* notice the absense of the '\r' */ when using VxWorks 5.5. Is this behavior even OS dependent? Is it hardware ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Carriage Return and New Line - Are the both necessary?

  1. Carriage Return and New Line - Are the both necessary?

    Hi,

    I'm trying to learn whether it's necessary to say:

    printf("something\n\r");

    or whether it's sufficient to just say:

    printf("something\n"); /* notice the absense of the '\r' */

    when using VxWorks 5.5. Is this behavior even OS dependent? Is it
    hardware dependent? If it is, I'm using a Dy4 SVME-181. Just curious.
    Thanks in advance!


  2. Re: Carriage Return and New Line - Are the both necessary?



    "vimal.gopal@gmail.com" wrote:

    > Hi,
    >
    > I'm trying to learn whether it's necessary to say:
    >
    > printf("something\n\r");
    >
    > or whether it's sufficient to just say:
    >
    > printf("something\n"); /* notice the absense of the '\r' */
    >
    > when using VxWorks 5.5. Is this behavior even OS dependent? Is it
    > hardware dependent? If it is, I'm using a Dy4 SVME-181. Just curious.
    > Thanks in advance!


    in general, you don't need the '\r'. If the OS needs it then the runtime
    system will put it in for you, assuming the file is opened in text mode
    (stdio is).

    David


+ Reply to Thread