Content originally posted in LPCWare by JohnR on Sun Sep 09 05:39:23 MST 2012
Maybe the string has to be null-terminated?
From MSDN re atof()
The input string is a sequence of characters that can be interpreted as a numerical value of the specified type. The function stops reading the input string at the first character that it cannot recognize as part of a number. This character may be the null character ('\0' or L'\0') terminating the string.
Hope this helps.
JohnR.