Nominate our 2022 Qt Champions!

qDebug()<< bug

  • I have a problem, when I run the program by pressing ctrl+r with the help of qdebug()<<var; I see that my variable has trash in it(-12321+e smth like this), but when I run the program again in the debug mode it shows that the variable has the value which I need and the qdDbug()<<var; shows the value which I want. What can cause such situation???

  • Moderators


    Did you initialize var? How did you set the value which you want?

  • @JKSH Yes the value has been initialized. I init. with some minor calculations such as:
    QVector <double> B;
    for(int i=1;i<ui->RyadA->text().toInt(0,10)+1;i++){

Log in to reply