Windows carriage return is \r\n while it is \n in Unix, is \r\n treated as two characters?
Windows carriage return is \r\n while it is \n in Unix, is \r\n treated
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
These are two characters:
\ris carriage return;\nis line feed.Two characters combined represent a new line on Windows. Whereas on Linux,
\nrepresents new line. It moves cursor to the start of new line on Linux. On Windows, the cursor will stay at the same column in the console but on the next line.\ron Linux has the same effect as on Windows: moves cursor to the start of the line. It is possible to print different information on the same line where\ris used instead of\n.