What is ascii value of null
It's actually was like NOP— it doesn't play any role, when it is sent to a printer or a terminal, nevertheless, some terminals display it as space, which wasn't correct. At past times, when people used electromechanical teleprinters in the role of computer output devices, one or even a couple of null characters were used in the following way. They were sent at the end of each printed line in order to let the mechanism take its time just to return to the first printing position on the next line.
There is no a single hole on the character on punched tape, so a completely new tape which wasn't punched is totally filled with null characters. This way, the text could often be "inserted" at a specially kept for this space of null characters by punching the new characters into the tape, covering the nulls. Nowadays the null character is of primer importance in C and its derivatives and in many data formats as well. There it plays a role of the reserved character which function is to show the end of a string, which is frequently called a null-terminated string.
Online Test Take a quick online test. C Programs. C - Arrays and Pointers. C - Stacks and Queues. C - Linked Lists. C - Matrices. Discussion Forum. Confused About the Answer? Easy Normal Medium Hard Expert.
Writing code in comment? Please use ide. Load Comments. What's New. Most popular in Computer Subject. Improve this question. NPE k 97 97 gold badges silver badges bronze badges. Abhinav Abhinav 47 1 1 gold badge 2 2 silver badges 4 4 bronze badges. You could not implement null-terminated strings without NUL. Its use in that context is as a sentinel value. Add a comment. Active Oldest Votes. To quote Wikipedia : ASCII reserves the first 32 codes numbers decimal for control characters: codes originally intended not to represent printable information, but rather to control devices such as printers that make use of ASCII, or to provide meta-information about data streams such as those stored on magnetic tape.
Its original purpose, however, was different : The original meaning of this character was like NOP -- when sent to a printer or a terminal, it does nothing some terminals, however, incorrectly display it as space.
0コメント