QString unsigned char * 相互转换

Qt unsigned char *与QString之间的相互转换
//unsiged char *转QString

unsigned char  *str = "fdd" ;
char *str1 = (char *)str;
QString str2 = QString(QLatin1String(str1));

//QString 转化成char *

QString str = "fdd";
QByteArray ba = str.toLatin1();
unsigned char * str1  = (unsigned char *)ba.data;
上一篇:消息中间件学习笔记--ActiveMQ(三、主题模式)


下一篇:mootools1.3.1源码解读