How do I convert CString into const char *? I have tried everything found on the internet but I still cant convert them.
Please help.
Thank you.
First : define char *inputString; in your_file.h
Second : define in yourFile.cpp : CString MyString;
MyString = "Place here whatever you want";
inputString = new char[MyString.GetLength()];
inputString = MyString.GetBuffer(MyString.GetLength());
The last two sentences convert a CString variable to a char*; but be carefull, with CString you can hold millons of charcteres but with char* no. You have to define the size of your char* varible.