answersLogoWhite

0

How newline character formed?

Updated: 12/21/2022
User Avatar

Wiki User

8y ago

Best Answer

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How newline character formed?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does chomp do in perl?

Most commonly it's used to remove the newline character from the end of a string or an array of strings. If the newline character isn't there, then nothing is done to the string. There are other details involved in what chomp does, but mostly that is what it is used for. For instance you can change which character is considered the be the newline character. If you want to know more, I would suggest reading the documentation.


How newline formed?

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.


How is the newline formed in c plus plus preprocessor?

\x0a in unix, \x0d\x0a in Win/Dos


End of line character in mainframe file?

The end of line character on an IBM mainframe is the newline character (same as it is on Ascii platforms). The value, however, is different. It is a hex 0x25 (EBCDIC)


New line inside the command text?

The newline character is used to mark the end of each line in Unix/Linux. Usually the character is specified as the '\n' character, which equates to a 0x0A character in Ascii based systems.


Difference between BufferedWriter and FileWriter in java?

A newLine() method is provided, which uses the platform's own notion of line separator as defined by the system property line.separator. Not all platforms use the newline character ('\n') to terminate lines. Calling this method to terminate each output line is therefore preferred to writing a newline character directly, FileWriter doesn't have this feature. ALso BufferedWriter are fast as they write to buffer first before writing to file


When is a newline not equivalent to space or tab?

Always. A newline is neither a space nor a tab.


How do you end a while loop by accepting newline in integer variable?

A newline has ASCII character code 10, therefore you test for the integer value 10. That's not much use if the user needs to enter 10, therefore you should test the input before assigning the integer.


What is the special character used to match any single character in a search string?

If you're using regular expressions, the character commonly used is a dot '.'. This will match any character except a newline. To match all characters including newlines would involve a statement, not a single character.


To count the number of characters in the given text file in unix?

Look at the "wc" command's man page, it will give you a count of all characters, including the newline character.


What is the difference between forward slash and backward slash in c?

forward slash - division operator backward slash - special character (e.g. \n - newline) in C strings


What is ascii value of newline?

10 = 0AH