3

I want to convert tchar* variable to double for my project. How can i do that?

TCHAR *t = _T("1000.99");
Deadlock
  • 4,211
  • 1
  • 20
  • 25
Jamesfrank
  • 33
  • 4
  • 2
    Windows 95 was released exactly 20 years ago. Do you still need to support non-Unicode systems? Because if you only support Windows XP or newer, just use `L"1000.99"`. – MSalters Aug 25 '15 at 09:47

1 Answers1

4

use _tcstod() to convert TCHAR to double.

TCHAR *t = _T("1000.99");
LPTSTR endPtr;
double dValue = _tcstod(t, &endPtr);
Deadlock
  • 4,211
  • 1
  • 20
  • 25