
3 Dec
2008
3 Dec
'08
7:11 p.m.
Hi,
Please do not proceed at the expense of error handling. I believe using itoa and ftoa is fine, but using atoi and atof is definitely not:
cout << atoi("123X") prints 123 cout << atoi("X") prints 0
lexical_cast<int> throws in both cases, which I think is 100% the correct behaviour.
Would strtol() and friends be suitable from a performance point of view? They at least provide some error reporting. -Ossama