1.控制台输出 helloworld
#include<QtCore/QCoreApplication> #include<QDebug> int main(int argc,char *argv[]){ QCoreApplication a(argc,argv); qDebug() << "hello world"; return a.exec(); }
2.控制台输出 helloworld(QString应用)
#include<QtCore/QCoreApplication> #include<QDebug> int main(int argc,char *argv[]){ QCoreApplication a(argc,argv); QString mStr="hellowlrd"; qDebug() << mStr; return a.exec(); }