I'm writing very simple code for an array and i get this error...can anyone help? it seems to have to do with my array and the fact that i'm using "double"
: error C2057: expected constant expression
: error C2466: cannot allocate an array of constant size 0
: error C2133: 'b' : unknown size
Here is my code ....what am i doing wrong?
cin>> n ;
q = 1 - p;
y = p/q;
b = pow(q,n);
for (k = 1; k < n;)
b[k] = ((n-k+1)*b[k-1]* y )/ k;