Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The data types on both sides of the assignment symbol "=" must be the same.
The data types on both sides of the assignment symbol "=" must be the same.
Principles need consistency, not necessity. For example, assigning an integer to a floating-point variable automatically promotes integer data to a floating-point type; On the contrary, assign a floating-point data to an integer variable and only take the integer part-at this time, the system will give a warning prompt because the data accuracy is damaged. In short, when the "short" data is assigned to the "long" variable, it will automatically promote the short to the long, while when the "long" data is assigned to the "short" variable, the data will be truncated and there will be a warning when compiling ... so it is better for both sides to be of the same type, and the code will be rigorous!