By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,130 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,130 IT Pros & Developers. It's quick & easy.

How to convert CString to an ASCII character string?

P: n/a
jt
Looking for an example how to convert and CString to an ASCII character
string.

Any examples on how to do this?

Thank you,
jt

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Looking for an example how to convert and CString to an ASCII character
string.


IIRC, CString has an automatic conversion to const char*, if that's
what you mean by an ASCII character string. If not, ask in a microsoft
dedicated newgroup.

CString cs("hello");
const char *s = cs;

Jonathan

Jul 23 '05 #2

P: n/a
1. Just copy CString into some ASCII character array,(using strcpy() )
TCHAR cstr[200];
CString str="jt";
_tcscpy(cstr,(LPCTSTR)str); ////_tcscpy() is strcpy() when _UNICODE &
_MBCS both not defined.

2. look on MSDN for CString
3. Since it is pure C++ group, to submit VC++ problems, try on codeguru
discussion forum - http://www.codeguru.com/forum/

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.