在pro中添加CONFIG += console
#include “mainwindow.h”
#include “ui_mainwindow.h”
-
MainWindow::MainWindow(QWidget *parent)
-
QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
// QString str = “sfsfddsfsdsdffsddsf”;
int num = 20;
char str[20]="hello world";
qDebug(" %d %s", num, str);
}
MainWindow::~MainWindow()
{
delete ui;
}