typedef char * (*some_lib_func) (char *, int, char *, char *);HINSTANCE handler;handler = LoadLibrary ("some_lib.dll");if (!handler){ std::cerr << "Could not load some_lib.dll\n"; ...}some_lib_func a = (some_lib_func) GetProcAddress (handler, "some_func");if (!a){ std::cerr << "Could not find function some_func\n"; ...}...FreeLibrary (handler);
return http->readlAll().data();
struct http_data_t{ char * data; qint64 size;};http_data_t * read_http_data(){ .. http_data_t * h = new http_data_t; h->size = http->bytesAbailable(); h->data = new char[ h->size ]; http->read( h->data, h->size ); return h;}void destroy_http_data( http_data_t * h ){ delete[] h->data; delete h;}
const char * data = http->readAll().constData();// data already invalid, because QByteArray was destroyedreturn data;
const char * data = QString( "ABC" ).toLatin1().toLower().constData();
QString mefunc(){ .. .. //Что-то делаемif (....){} else return QString();}