Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Freshman C++ Question: Can bivariate be assigned to plastic variables? What about personality types? What is the basic principle of data type conversion?
Freshman C++ Question: Can bivariate be assigned to plastic variables? What about personality types? What is the basic principle of data type conversion?
Hello, landlord

The conversion rule of data type is:

(1) The conversion from high type (emphasizing high precision) to low type (emphasizing low precision) is generally warned by the compiler.

Because high-precision data will lose its original accuracy when it becomes low-precision, it is easy to lose data.

For example, double a=5.5.

int b=a

Here b=5 loses the precision of one decimal place.

The data is not accurate, but it can be converted.

(2) The conversion from low type to high type will be normal without warning.

As for the character type, it can be assigned to integer variables.

If the landlord knows ASCII code

Then assigning a character to an integer variable means assigning the ASCII code (integer) corresponding to this character to an integer variable.

As the landlord is a freshman, he may have only been exposed to c++, so be it. Ha _)

I hope I can help you.