Chang
asked on
String to Char[ ]
Is it possible to convert a string into a char array? I have tried strcpy() and many other functions with no success.
CString in an MFC class. Do you mean the STL string class called "string"? If not one of those, what do you mean by "string" ?
ASKER
I'm sorry, for not phrasing my question properly. I thought there might be a way to convert all string types to a char[] type. I have raised the points for your troubles, sorry.
I want to convert a an LPTSTR to a WCHAR, here are my 2 variables in my program:
WCHAR LPtemp[500];
LPTSTR fName;
I want to convert a an LPTSTR to a WCHAR, here are my 2 variables in my program:
WCHAR LPtemp[500];
LPTSTR fName;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I figured out the problem, it was an extreemly simple solution compared to what I was trying to do. I do not think the conversion I was trying is even possible. Your answer did however lead me in the right direction, thank you very much for your help nietod!
CString Str = "Test STring";
char szStr[32];
strcpy((char*)szStr, LPCTSTR(Str));