// mystring.h #ifndef MYSTRING_H #define MYSTRING_H #include <QString> class MyString : public QString { public: MyString(); operator char*() { QByteArray ba = toLocal8Bit(); return ba.data(); } void operator =(const QString& str){ clear();append(str);} }; #endif // MYSTRING_H // main.cpp file #include <mystring.h> int main(int argv,char* argc[]) { char* strChar = NULL; MyString strMy; strMy = "Hello"; strChar = strMy; int i = 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)