Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What kind of data is char?
What kind of data is char?
Char is: C/C++ integer data type.

Char is used to define character variables in C or C++, occupying only one byte, and the range of values is-128 ~+127 (-2 7 ~ 2 7-1).

C languages such as int, long, short, etc. When signed or unsigned is not specified, it is signed by default, but char does not specify signed or unsigned in the standard, and the compiler can compile with or without sign.

Type: one of c/c++integer data.

Another special language about char is char *, which has special semantics in C/C++, which is different from both signed char * and unsigned char * and is specially used to refer to strings ending in' \0'.

Integer data classification:

1, char: character data, which is an integer data and occupies one byte.

2.unsigned char: unsigned character data, which is a kind of integer data and occupies one byte.

3.short: short integer data, which belongs to one kind of integer data and takes up two bytes.

4. Unsigned short integer: unsigned short integer data, which belongs to a kind of plastic data and occupies two bytes.

5.int: integer data, which belongs to one kind of integer data and occupies four bytes.

6.unsigned int: unsigned integer data, which belongs to one kind of integer data and occupies four bytes.

7.long: Long integer data, which belongs to one kind of integer data and occupies four bytes.

8. Unsigned long integer: unsigned long integer data, which belongs to a kind of plastic data and occupies four bytes.

Reference to the above content: Baidu Encyclopedia -char