a very simple complex number question for you please

Mar 11, 2013 at 4:40pm
Guys, I have a very simple question for you, Please help me. Thanks alot!!!

#include < iostream>
#include < complex>

using namespace std;

int main()
{

int k=200000;

complex <double> r0[k/2],r1[k/2]; ///wrong!!!

complex <float> r0[k/2],r1[k/2]; ///right


return 0;
}


I just wanna create a complex array. k=200000 here (need to be big like this), the computer stop working(not error, it shows my file stop working), if i just complex <double>, it works with complex<float>! Someone please tell me the reason please, thanks again!!!
Mar 11, 2013 at 4:42pm
Both are wrong.
Have you even compiled this?

have a read of this too:
http://www.cplusplus.com/reference/vector/vector/

Last edited on Mar 11, 2013 at 4:43pm
Apr 15, 2013 at 5:02pm
Hey, mutexe. I think I got it. Thanks!!
Topic archived. No new replies allowed.