Click to See Complete Forum and Search --> : MFC String: How to convert a 'char*' to 'CString'?


Gabriel Fleseriu
February 14th, 2003, 03:48 AM
Q: How to convert a 'char*' to 'CString'?

A: Use either the constructor of 'CString' or its assigment operator:


char* str = "Hello";
CString cs(str);

or


CString cs;
cs = str;

<br><br>