Hi
i want to convert CString to char* and vice versa.
regards
ram
Printable View
Hi
i want to convert CString to char* and vice versa.
regards
ram
simple sample:
CString strString;
char chString[256];
strString = "Hello";
MessageBox(NULL, strString, "CString", MB_OK);
sprintf(chString, "%s", (LPCTSTR)strString);
MessageBox(NULL, chString, "char String", MB_OK);
sprintf(chString, "%s", "Hello again");
MessageBox(NULL, chString, "char String 2", MB_OK);
strString.Format("%s", chString);
MessageBox(NULL, strString, "CString 2", MB_OK);
For more, better and specific information, please refer to the Online-Help-Article "String Topics"
(VC++ doc->using vc++->vc++ prog. guide->adding prog. functionality->details->string topics)
"Writing a comment in your source does not necessariliy mean that your source is commented"
use LPTSTR CString::GetBuffer(n) method
Bayram