double to int c++

C++
double x = 5.4;
int y = (int) x;
Source

Also in C++: