|
-
September 20th, 2001, 12:16 AM
#1
CString to char*
Hi
i want to convert CString to char* and vice versa.
regards
ram
-
September 20th, 2001, 12:49 AM
#2
Re: CString to char*
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"
-
September 20th, 2001, 12:54 AM
#3
Re: CString to char*
use LPTSTR CString::GetBuffer(n) method
Bayram
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|