QT do while loop
问题 I am learning QT these days and I wanted to test do while loop , the actual login works in normally, but in QT the application freezes .. I have defined randnum and guess in the header file ( public ) void MainWindow::on_pushButton_clicked() { srand (time(NULL)); randnum = rand() % 10 +1; do { guess = ui->spinBox->value(); if (guess < randnum) { ui->label->setText("try something big"); } else if (guess > randnum) { ui->label->setText("try something small"); } else ui->label->setText("YAY?");