Results 1 to 4 of 4

Thread: Diff- \r and \n

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    30

    Diff- \r and \n

    What is the difference between carriage return and newline?

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    10000 light years away
    Posts
    143
    \n is in fact the combination of carriage return and line feed; so that you go to the beginning og the next line

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    30
    Thanks but then what is the function of \r - carriage return?

    Printf ( " sss \r ddd");

    This line prints just ddd. why?

  4. #4
    Addicted Member
    Join Date
    Jul 2002
    Location
    10000 light years away
    Posts
    143
    The carriage return will return the cursor to the leftmost position without going to the next line. Obviously your sss is overwritten by ddd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width