I've inherited some code (from someone who has left) and found this little snippet:
double minX = xVal.find('.') == string::npos ? (double)atoi(xVal.c_str()) : atof(xVal.c_str());
double minY = yVal.find('.') == string::npos ? (double)atoi(yVal.c_str()) : atof(yVal.c_str());
Is there some reason why he chose to use atoi for integer types? I can't see a problem with:
double minX = atof(xVal.c_str());
double minY = atof(yVal.c_str());
Thanks.