complex arrays

Hi,

I basically want to read from a notepad file a series of numbers (e.g a 300 by 2 array), where the first number is the real part and the second number is the imaginary part of real data so that I end up with a list of complex numbers e.g

2.3 + 1.4i
4.5 + 2.7i
3.1 + 1.3i
.
.
.


I understand how to read from a file but am at a loss as to how to create an array of complex numbers. I've been doing a bit of readin around and from what I understand defining a complex number as,

complex<double> first (2.3,4.5);

already treats that as an array?

I require complex notation because I need to later carry out complex arithmetic on the data.

Any ideas/places to start/code would be great.

Thanks
I would suggest using a vector of complex<double> to store your values.
Adding to the vector would be a matter of just typing something like
complexvector.push_back(std::complex<double>(val1, val2));
Topic archived. No new replies allowed.