qtcreator和java_QtCreator 2.4.1控制台输入

我对C和QT有些新意 . 试图在QtCreator中运行一个非常简单的程序,它在WinXP上使用控制台输入:

#include

#include

int main() {

QTextStream streamOut(stdout);

QTextStream streamIn(stdin);

QString s1("This "), s2("is a "), s3("string.");

QString s4 = s1 + s2 + s3;

streamOut << s4 << endl;

streamOut << "The length of that string is " << s4.length() << endl;

streamOut << "Enter a sentence with whitespaces: " << endl;

s4 = streamIn.readLine();

streamOut << "Here is your sentence: \n" << s4 << endl;

streamOut << "The length of your sentence is: " << s4.length() << endl;

return 0;

}

问题是原生QTCreator的应用程序输出,因为它的名称,不支持输入内容 . 这是应用程序输出:

启动C:\ QProject \ test-build-desktop-Qt_4_8_0_for_Desktop_-MinGW_Qt_SDK ___> z >> \ debug \ test.exe ...这是一个字符串 . 该字符串的长度为17输入带有空格的句子:启用Qml调试 . 只能在安全的环境中使用它!

我已经尝试在项目>桌面>运行中检查“在终端中运行”,因为这里建议的类似问题的一些答案和终端显示,但它似乎无论如何都不与程序交互 . 终端输出:

按RETURN关闭此窗口...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值