Is there a way to convert a float or double to an int without triggering a warning?
I'm kinda anal and hate having warnings show up when I compile.
Is there a way to convert a float or double to an int without triggering a warning?
I'm kinda anal and hate having warnings show up when I compile.
You can just cast it.
Code:float f = 10.f; int x; x = (int)f;
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers