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?");
} while (guess != randnum);
}
please tell me how to find the reason why it freezes.. thanks !