对于循环输出到QT中的字符串
问题是我希望我的输出像字符串一样可用。
代码:
string message = "ASD";
qDebug() << "Message in ASCII Dec : ";
for(int i=0; i < message.length(); i++) {
cout << (int)message.at(i) << "";
}
输出:
658368
the problem is i want my output as a usable like string.
Code:
string message = "ASD";
qDebug() << "Message in ASCII Dec : ";
for(int i=0; i < message.length(); i++) {
cout << (int)message.at(i) << "";
}
Output:
658368
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要包含658368的字符串,请使用以下方式:
如果您希望结果在ASCII中转换回ASCII,请
在使用QT Creator时使用QString代替常规字符串,它提供了许多功能强大的功能
If you want a string that contain 658368, use this :
If you want your result to get converted back in ASCII, use
Use QString instead of regular string when you use Qt Creator, it provides a lot of powerful function