954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

TCHAR to std::string

Goodmorning,

Can anyone tell me how to convert a TCHAR to a std::string ??

Thanks....

disc
Light Poster
29 posts since Sep 2006
Reputation Points: 10
Solved Threads: 1
 

TCHAR is just a macro that is defined to be either char* or wchar_t*, depending on whether your program is compiled with UNICODE or not. If not UNICODE then use just simple assignment to convert to std::string. If the program is UNICODE then use one of the conversion functions, such as wcstombs(). That function works ok with English language, but I don't know about other languages.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Thanks Ancient Dragon, 'problem' solved....

disc
Light Poster
29 posts since Sep 2006
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You