Space Character And NULL Character It is different. In ASCII, the ASCII code of the Space symbol is 32, while the empty character is 0, and the two are completely different 2 characters.
NULL Character It is generally used to describe the end of a string. It is actually a type of control character, but it cannot be understood as having no character. It should be understood as representing nothing. for example, the carriage return 0x0a and line feed 0x0d are not displayed, but they are also a type of control characters. (These characters were previously used for printers, so many of them are useless)
String Concept: In C, a string is a series of valid characters (including letters, numbers, escape characters, and so on,Use '\ 0' as the string end flag. '\ 0' is a "null operation" character. It does not perform any operation, but is a flag. '\ 0'CodeThe value is 0, which is not counted in the length of the string.
Note:
When receiving stringsIf scanf receives the string, it cannot contain spaces. Otherwise, it will use spaces as the end character of the string.. If you type Harry Potter, scanf can only get the word Harry. ThereforeIf you receive spaces, you can use the gets () function..
Is the output space character in C language different from that in output space?
The output space is displayed as a space on the screen. However, empty characters are not displayed. Because the null character is used as the end sign of a string.
Line feed (\ n, ASCII code: 10)That is, the cursor moves down a line but does not move to the beginning of this line,Press enter (\ r,ASCII code: 13) Is to return to the beginning of the current row without moving down a row.
EnterAfter pressing it, \ n \ r will be executed, which is the general meaning of the carriage return. Therefore, you can view the text in a hexadecimal file, \ n \ r will be found at the end of the row ".
Tab(\ T, ASCII code: 9)It is a Tab character. It is used to reserve the display width of 8 characters for alignment.