In C language, the storage form of char type data in memory is ASCII code. In C language, char type data puts a character constant into a character variable. It does not put the character itself into the memory unit, but puts the corresponding ASCII code of the character into the storage unit.
In C language, the storage form of char type data in memory is ASCII code.
In C language, char type data is to put a character constant into a character variable. It is not to put the character itself into the memory unit, but to put the corresponding character of the character. ASCII codes are placed into storage units.
The C language makes character data and integer data universal. A character data can be output in character form or integer form.
When outputting in character form, the ASCII code in the storage unit needs to be converted into the corresponding characters first, and then output. When outputting in integer form, directly output the ASCII code as an integer.
Original code, complement code and complement code are binary fixed-point representation methods of numbers.
Extended information:
1. In computers, all data must be represented by binary numbers when stored and operated. (Because computers use high and low levels to represent 1 and 0 respectively)
ASCII code uses a specified 7-bit or 8-bit binary number combination to represent 128 or 256 possible characters. Standard ASCII code, also called basic ASCII code, uses 7 binary digits (the remaining 1 binary digit is 0) to represent all uppercase and lowercase letters, numbers 0 to 9, punctuation marks, and special controls used in American English. character.
2. There are three ways to represent symbolic numbers in computers, namely original code, complement code and complement code. All three representation methods have two parts: sign bit and numerical bit. The sign bit uses 0 to represent "positive" and 1 to represent "negative". However, the numerical bits are different in the three representation methods.
In computer systems, values are always represented and stored using two's complement codes. The reason is that using the complement code, the sign bit and the numerical field can be processed uniformly; at the same time, addition and subtraction can also be processed uniformly. In addition, the operation process of converting complement code and original code is the same, and no additional hardware circuit is required.
Recommended tutorial: "C Language Tutorial"
The above is the detailed content of What is the storage form of char type data in memory in C language?. For more information, please follow other related articles on the PHP Chinese website!