Thread: whats diffrence between newline and carriage-return?

  1. #1
    Registered User
    Join Date
    Nov 2006

    Exclamation whats diffrence between newline and carriage-return?

    hi friends,

    whats diffrence between newline character and carriage return character?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Rishon LeZion, Israel
    They have different ASCII codes,
    different OS use one or both of these symbols to indicate new line in the text file

    I remember there was some usefull post not very long time ago about text-file formats and differences on different OSes... You can try to serch forum for this post...

    Ahhh, here it is
    Look for the post of Cat
    Last edited by vart; 12-26-2006 at 04:59 AM.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    To be exact: (Clicking on the small #3 in the top-right corner of the post gives you that.)

    BTW, you can print a newline character with '\n' and a carriage return with '\r'.

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Font size?
    By maniac20 in forum C Programming
    Replies: 6
    Last Post: 05-06-2008, 06:20 AM
  2. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 05:44 PM
  3. fgets - It will always return [string]\n\0 ?
    By stevong in forum C Programming
    Replies: 7
    Last Post: 12-01-2005, 12:17 PM
  4. info on "return" order in functions
    By Bigbio2002 in forum C Programming
    Replies: 10
    Last Post: 11-19-2003, 04:53 PM