Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between c++long and int?
What's the difference between c++long and int?
First, the data types are different.

1, long: refers to a long integer data, which is the basic data type in programming languages.

2.int: int is a data type and an identifier used to define integer variables.

Second, the data range is different.

1, long: the default is a 4-byte signed long integer, and the value range is-231~ (231-1).

2.INT: NT occupies 4 bytes and 32 bits, and the data range is-2147483648 ~ 2147483647 [-231~ 231].

Third, the characteristics are different.

1, long: The data types of long integers are divided into signed long integers and unsigned long integers.

2. In addition to int:int types, there are short, long and long long types that can represent integers.

Baidu encyclopedia -INT

Baidu encyclopedia-dragon