I haven’t written a lot of C++ using Visual Studio 2008, as I usually write .NET apps using C# these days.  However, I was writing a quick little console program in C++ and needed to convert command-line arguments to doubles.  By default the Project Wizard creates the code to use Visual Studio’s _t functions, which are really macros that expand to functions that accept either ANSI or wide strings, depending on whether _UNICODE and _MBCS are defined.

As a result, when I wanted to convert a string to a double, I used _ttof, which was the version that I’d used in the past with older versions of Visual Studio.  It is resolved to either atof or _wtof by the preprocessor, depending on whether the symbols listed above are defined.

However, when I tried to compile, I got

error C3861: '_ttof': identifier not found

This puzzled me, as I’d included tchar.h, stdlib.h and math.h. After a couple of minutes of pondering, I rechecked the docs and noticed that there was another version of the function, _tstof. Out of curiosity, I replaced _ttof with _tstof and recompiled. It worked. I then opened up tchar.h and found a definition for _tstof, but not _ttof. A little googling turned up this thread at EggHead Cafe, where Joe Newcomer, a long-time Visual C++ MVP, pointed out that MS decided to change the names on us but not mention this in the documentation.

I tried to add a note via the “Community Content”, but got an error saying that it couldn’t be saved.  It’s too bad, as it might have saved someone else some time.