how to declare dynamic array in double data type(c++)?

I am trying to declare a dynamic array in 'double' data type. I used the following command for that,

double *array = new double[i];

but I am getting compilation error for this command. Can anyone help me?
what error do you get?

I couldnt understand it, but i have pasted the message here:

compile log displays:


error: expression in new-declarator must have integral or enumeration type
Last edited on
maybe something is wrong with the loop that produces i
are you sure i is an integer type?
@ nevermore28 and timprograms : as you said, the problem was with the 'i' . thanks a lot!
Topic archived. No new replies allowed.