use static_cast
#include <iostream> using namespace std; int main() { int i; float f; f = 199.22; i = static_cast<int> (f); cout << i; return 0; }