whats diffrence between newline and carriage-return?

This is a discussion on whats diffrence between newline and carriage-return? within the C++ Programming forums, part of the General Programming Boards category; hi friends, whats diffrence between newline character and carriage return character?...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Exclamation whats diffrence between newline and carriage-return?

    hi friends,

    whats diffrence between newline character and carriage return character?

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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 The diference between binary and text
    Look for the post of Cat
    Last edited by vart; 12-26-2006 at 04:59 AM.
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    To be exact: The diference between binary and text (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'.
    dwk

    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: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    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, 07:20 AM
  2. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21