Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert floating-point type to integer type in C++ operation?
How to convert floating-point type to integer type in C++ operation?
int(a); //is to convert floating-point number a into an integer.

//Reference code?

# Contains? & ltiostream & gt

Use? Namespace? std

int? Master ()

{

Floating? a = 12.345;

int? b =(int)a;

cout & lt& ltb;

Return? 0;

}

/* Running result:?

12

*/