Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - [C language] 1. What is the difference between integer data and real data? 2. In order to prevent data overflow, you can directly define variables that occupy more storage details.
[C language] 1. What is the difference between integer data and real data? 2. In order to prevent data overflow, you can directly define variables that occupy more storage details.
Question 1

Integer is an integer with no decimal, and real is a floating-point number, that is, a real number, which can be a decimal.

Real variables are divided into three categories: single precision (floating point type), double precision (double precision type) and long double precision (long double precision type).

Integer variables are: short, int, long, etc.

Question 2:

Yes, for example, the short type is only 2 bytes, and the range is only -32768~32768. If the value is outside this range, you can use int or long.