Syntax Error Declaring Array & error C2133: 'pi' : unknown size
Posted on 2005-05-06
I am writing this code to solve an array problem but i keep getting errors.
i want to declare that pi = [1,0,0,0,0] but it keeps giving me an error. I am trying to declare that because i want to evaluate pi[n] = (pi[n-1]) * 3 for a set of n numbers until pi[n] - pi[n-1] <= 200
I used the for loop insde because i want n to increase and put it in the do while loop so i can tell it to stop.
PLease help..... what am i doing wrong?
using namespace std;
double pi = [1,0,0,0,0];
for (n=1; n>100; n++)
pi[n] = (pi[n-1]) * 3;
while pi[n] - pi[n-1] <= 200;