What are the different techniques used to convert float type of data to integer in C++?
#include using namespace std; struct database { i
Check out the boost NumericConversion library. It will allow to explicitly control how you want to deal with issues like overflow handling and truncation.
Normal way is to:
float f = 3.4; int n = static_cast<int>(f);