Hello im coding in C++ and i need some help with converting a double to an int. what a need is a way to get the first number from a double ie (3.5945) "3". and put that number into an int.
I'm using static_cast now and its returning a 0.
double X = 3.1234;
double Y = 4.3455;
int myIntX = static_cast <int>(X);
int myIntY = static_cast <int>(Y);
cout << myIntX << endl;
cout << myIntY << endl;
output....
0 0