How to convert CString to an ASCII character string?

J

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
 
J

Jonathan Mcdougall

Looking for an example how to convert and CString to an ASCII character

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
 
U

upashu2

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top