Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The difference between the storage of characters and integer data is that there is an extra'' in writing. What is the difference in essence?
The difference between the storage of characters and integer data is that there is an extra'' in writing. What is the difference in essence?
First, we should distinguish how data constants are represented:

Character constants are represented by using'' as a separator, such as letters a and' a', which is different from identifiers, such as

char a; //a is a variable,

A =' A//a stores the characters A,' a,' a is a character constant, which is the data value stored by A.

Integer constants can be expressed in many ways, the most commonly used is decimal representation, such as123,454 and so on.

Whether it is character or integer data, the storage form in the computer is binary number:

Character constants are expressed in ASCII code. For example, the letter A stands for' a' and is stored as 0 10000 1, accounting for one byte.

Integer data is directly stored as binary numbers, for example, 123 is stored as 00000001111,16 bits, accounting for 2 bytes.