博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
QString 和std::string互转
阅读量:4581 次
发布时间:2019-06-09

本文共 250 字,大约阅读时间需要 1 分钟。

std::string cstr;

QString qstring;

//****从std::string 到QString

qstring = QString(QString::fromLocal8Bit(cstr.c_str()));

//****从QString 到 std::string

cstr = string((const char *)qstring.toLocal8Bit());

转载于:https://www.cnblogs.com/hermit/p/3783422.html

你可能感兴趣的文章
29输出图形:习题三角形输出
查看>>
18递归:39级台阶
查看>>
【Luogu】P1948电话线(二分SPFA)
查看>>
线程的创建方式比较
查看>>
Spring IoC的实现原理
查看>>
第一次实训作业
查看>>
微信小程序跳转(当我们不知道是普通页面还是tabbar)
查看>>
mac系统下安装和启动nginx
查看>>
linux c 获取文件大小
查看>>
将博客搬至CSDN
查看>>
21. 让指针数组结尾带NULL,使遍历时不依靠计算整个数组大小就可以在结尾遍历结束...
查看>>
阅读作业2李嘉良篇
查看>>
崔博:离开盛大的日子 创业两年回顾
查看>>
sqli-labs(41) and 两php函数的讲解
查看>>
建立动态二维数组
查看>>
selenium之chrome驱动版本
查看>>
sed命令详解
查看>>
Java基于socket的进程间通信 聊天小程序
查看>>
spark集群构建
查看>>
P3932 浮游大陆的68号岛
查看>>