Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Is it allowed to store integer values in real variables in C language? Why?
Is it allowed to store integer values in real variables in C language? Why?
Floating-point (real) variables can store integer values. C language will implicitly convert integer values into floating-point values and assign them to floating-point variables.

Example: double d =10;

Actually equivalent to: double d = (double)10;