round() may not be part of the C99 standard, but I know that my math library has it in it. I've used it on occasion. I use MinGW
Doing a C cast on any of the primitives to and integer will do an implicit round.
Code:float x = 1234.56; int i = (int)x; cout << i << endl;




Reply With Quote