static_cast conversion
C++ C++ language Expressions
Converts between types using a combination of implicit and user-defined conversions.
Syntax
static_cast < new_type > ( expression )
Returns a value of type new_type.
#include <iostream>
using namespace std;
int main()
{
float f = 3.5;
int a = f; // this is how you do in C
int b = static_cast<int>(f);
cout << b;
}