当这个循环回到 dd[0] 周围时设置为 0 与 256.1 相对?似乎 'dd' 内存正在重置, 'aa' 回到 0。
unsigned char aa = 0;
double *dd = new double[256];
//circular buffer
dd[aa] = 0.1;
for(int i = 0; i < 600; i++){
qstr += QString::number(aa,'d',0) + " " + QString::number(dd[aa],'f',1) + " ";
aa++;//onces 'aa' reaches 255, the next increment resets back to 0 for 'aa'
dd[aa] = dd[aa - 1] + 1;
}