views:

415

answers:

2

I have a C++ application where I'm replacing a number of sscanf functions with atoi, atof, etc... for performance reasons. The code is TCHAR based so it's _stscanf getting replaced with _ttoi and _ttof. Except there isn't a _ttof on Windows Mobile 5, or even a _wtof for explicit wide character support. I've ended up using _tcstod instead, but that takes an extra parameter that i'm not very interested in. So any ideas why there is no _ttof, _tcstof() or _wtof in Windows Mobile 5.0. It's there in VS2005. Am I missing something really obvious here?

+1  A: 

One of the problems of Windows Mobile is the size of RAM and ROM on the device. Therefore a lot of the redundant routines are removed to make sure the OS is as small as possible.

Tommy Hui
A: 

If the data you want to convert is guaranteed to be only in the ASCII charset you can always transform it to ASCII and cat atof, atol, atoi & friends.

I mean if you have something like this(pseudocode):

TCHAR buf_T[20]=_T("12345");
char buf_char[20];

from_TCHAR_to_ascii(buf_T,buf_char);

atoi(buf_char);
Iulian Şerbănoiu