How do I convert a CString data to a double?<br>
I need to perform calculations on string input.<br>
//This doesn't work - how to do it?<br>
CString string;<br>
double thedouble;<br>
thedouble = (double) string;<br>
<br>
DigitalOx<br>
There is a cast of LPCSTR for a CString, and a function "atof" to convert ASCII to double, so I would just change your third line above to:<br>
<br>
thedouble = atof((LPCSTR)string);<br>
<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.