Showing posts with label String and char*. Show all posts
Showing posts with label String and char*. Show all posts

5/11/2016

CString to char*

//CString -> char *
CString str;
str = "hello";
char * chr = LPSTR(LPCTSTR(str));

//char * -> CString
char chr[] = "hello";
CString str;
str.Format("%s", ss);

3/06/2014

(c, c++) 'char * to string' and 'string to char *'

//string to char*

string str = "hello";
char cstr[10];
strcpy(cstr,str.c_str());
 
// char * to string

char cstr[] = "hello";
string str = cstr; //string(cstr)