I am trying to assign part of a QVector
double array to complex double array in Qt.
Running the following code, I have the problem that std::cout << y.at(i) << std::endl;
correctly prints a 16-bit integer value but std::cout << y1[i] << std::endl;
prints zeros: (0,0) (0,0) (0,0) ...
I would like the result (y[0],0) (y[1],0) (y[2],0)...
Please can someone advise what is wrong?
QVector<double> x(100), y(100); // Original QVector
std::complex<double> y1[100];
int i=0;
while(i<101)
{
// get y values from somewhere else (quint8 data8)
y[i] = (256.0*data8[2*i]) + 1.0*data8[2*i+1];
std::cout << y.at(i) << std::endl;
y1[i] = (y.at(i),0.0);
std::cout << y1[i] << std::endl;
i++;
}