qDebug的使用

初步使用说明

#include <QCoreApplication>
//包含头文件
#include <QtDebug>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QString str1="Hello";
    str1=str1+" to you!";
    int ac=2;
    //不能忘记带括号
    qDebug()<<str1; 
    qDebug("The number is %d",ac);
    qDebug()<<"The number is"<<ac;
    return a.exec();
}

猜你喜欢

转载自blog.csdn.net/wei242425445/article/details/80154224