CString to char* array
In an app that I am writing I need to convert a CString variable to a char* array variable. I know that this is probably very easy but I just can't figure it out...
CString cs = "text";
sprintf(ch, "%s", cs);
or cs.GetString() may be what you need?
I think CString has a conversion operator that automatically converts it to const char*. For example:
strcpy(mybuf, blah); //invoke CString's const char * conversion operator
There is also a member function (I don't remember its name at the moment but you can check the online help of Visual C++) that returns a char array buffer, perhaps CString::data() or anything of that sort.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center