Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
i have a string value and i want to convert string value to TCHAR value.

What I have tried:

dont know how to convert in c++
Posted
Updated 27-Jan-20 1:21am

TCHAR is not a type, so there is nothing to convert. TCHAR is defined at compile time as either char or wchar_t depending on whether your project is set for ASCII or Unicode.
 
Share this answer
 
Comments
Maciej Los 27-Jan-20 8:54am    
5ed!
Quote:
i have a string value and i want to convert string value to TCHAR value.

A string is a sequence of characters, while TCHAR is a single character (either char or wchar_t as already pointed out by Richard), so you cannot convert.
As a wild guess, I suppose you need to convert from a string type to another string type. Then, have a loo at: How to: Convert Between Various String Types | Microsoft Docs[^].
 
Share this answer
 
Comments
Maciej Los 27-Jan-20 8:55am    
5ed!
CPallini 27-Jan-20 15:18pm    
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900