I was wondering if its possible to get the integer OR float value of a string. If I know it's an integer I can do int x = atoi(str) and atof if its a float but what do I do if I don't know what it is (in other words if I don't know if it's a float or an integer)?
Basically I have a string with two numbers (and a space between them) and I want to get the numbers, add them and print the result. (I know how to split the string)
Any ideas on that will be great. Thanks :)