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

    Hi,

    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++){
    B.push_back(((double)i/8+1)*(i+1));
    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.