May 16, 2012
Qt : Convert QString to char
Qt : Convert QString to char
QString have very much feature compared with char data type. But, in some of conditions, we need to Qt : convert QString to char datatype. This is a sample function how Qt : Convert QString to char datatype :
const char *QString2char(QString str)
{
QByteArray byteArray;
const char *cstr;
byteArray = str.toUtf8();
cstr = byteArray.constData();
return(cstr);
}
This is the sample method, how we can use Qt : Convert QString to char function above :
QString mystring; const char *char_data; mystring = "this is a string"; char_data = QString2char(mystring);
What do you think? Are you think this Qt : Convert QString to char is very simple 🙂
4 Comments
Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.bh/register?ref=JW3W4Y3A
I have been playing here for a while and the login process is so smooth. Customer support responds fast and the promotions keep getting better every month. Highly recommend checking out global77login
Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.com/register?ref=IXBIAFVY
[7349]Riotbet Login PH – Legit Online Slots at GCash Deposit,Mag-riotbet login ph na para sa legit online slots gcash. I-download ang riotbet app at alamin kung paano maglaro ng baccarat. Sali na at mag-enjoy! visit: riotbet