Combining Functions with different return types
How in the world do I combine these functions into one? Do I make them a template? I can't find anything similar out there. Please forward any help to <removed>
Code:
// Converts a String to an Integer
int GetIntVal(string strConvert)
{
int intReturn;
intReturn = atoi(strConvert.c_str());
return intReturn;
}
// Converts a String to a Double (Float)
double GetDoubleVal(string strConvert)
{
double doubleReturn;
doubleReturn = atof(strConvert.c_str());
return doubleReturn;
}