Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the basic data type of char?
What is the basic data type of char?
In C language, "char" is a basic data type that can accommodate a single character, that is, char is a descriptor of a character variable. The value of a character variable is a character constant, that is, a single character. The format and writing rules of type description of character variables are the same as those of integer variables.

In C/C++, programmers should be given the types of variables. There are two main types of data, one is a number type, the other is a character type, and "char" is a keyword that defines character type data.

For example, if you assign a value to the character variable a, you must first define it as CHAR A= "Hello ".

Extended data

Basic data types and rules in C language;

Shaping includes: char, short, int, long, long long, which are also marked with XX by default;

Rule: short has at least 16 digits; Int is at least the same as short; Long is at least 32 bits long and at least as long as int; Long Long is at least 64 bits long and at least as long as Long.

Among them, the last four digits have unsigned variants. Not signed? Short and unsigned? int、unsigned? Long and unsigned? For a long time. ?

Notice that unsigned itself is unsigned? Short for int.

On 32-bit computers and 64-bit computers, the only difference in shaping is the size of int and pointer, where int takes up 2 bytes on 32-bit computers and 4 bytes on 64-bit computers. The pointer size is the same as the int size.