Quantcast
Viewing all articles
Browse latest Browse all 4972

How to add integers into array

Hello i am new at QT so some errors i have i need to record three audio channel data streaming in. So i have created three arrays and checked how is it working but it seems array is not working normally, Three array has same values even if i give different channels. Channels show me exactly different numbers in text view as single numbers and i need to record them into three different arrays but same values but order is different       static int neg[]={};       static int xoer[]={};       static int guraw[]={};       static int nem=0; here is loop {     neg[nem]=(chan1.toInt());//string to int     xoer[nem]=(chan2.toInt());     guraw[nem]=(chan3.toInt());       nem=nem+1;           } after loop finishes i print them to see the three channel values {       for(int kaka=0;kaka<=nemex1;kaka++){          QString let= QString::number(neg[kaka]);          stringList->append(let);          listModel->setStringList(*stringList);     }       for(int kaka1=0;kaka1<=nemex2;kaka1++){         QString let1= QString::number(xoer[kaka1]);                                     stringList->append(let1);         listModel->setStringList(*stringList);      }         for(int kaka2=0;kaka2<=nemex3;kaka2++){         QString let2= QString::number(guraw[kaka2]);         stringList->append(let2);         listModel->setStringList(*stringList);     }   } then results are : chan1 : 6 270 274 0 261 270 0 chan2 : 270 274 0 261 270 0 265 chan3 : 274 0 261 270 0 265 274 just results are shifted but same no difference and other thing is threshold was 270 but there are numbers lower than 270…it means nothing is working normally what is wrong with me or QT? [edit Added missing coding tags @ SGaist]

Viewing all articles
Browse latest Browse all 4972

Trending Articles