如何将一个QString 输出到控制台中显示出来,我用cout怎么输出不了啊,谢谢
来源:百度知道 编辑:UC知道 时间:2024/05/15 16:43:24
楼上是正解。
QString filePath="C:/Qt";
cout<<fliePath.toLatin1().data()<<endl;
控制台输出:C:/Qt
类型转换下就行了,例如:QString aa=“123”;char *ch; ch=aa.toLatin1().data(); cout<<ch<<endl;
UC知道是一部内容开放、自由的互动网络百科全书
客观、专业、权威的知识性百科全书
来源:百度知道 编辑:UC知道 时间:2024/05/15 16:43:24
楼上是正解。
QString filePath="C:/Qt";
cout<<fliePath.toLatin1().data()<<endl;
控制台输出:C:/Qt
类型转换下就行了,例如:QString aa=“123”;char *ch; ch=aa.toLatin1().data(); cout<<ch<<endl;