systems of tridiagonal equation in C++

why doesn't the following code work? which code would work to solve a system of equations using newton's method approximation?

double epsilon=1e-6;
double x=1.0;
double f=x[j-1]-2x[j]+x[j+1] j=3...98; x3-x97+x98=3;
double Df=1-2+1;
while (fabs(f)>epsilon){
cout<<x<<endl;
x-=f/Df
f=x[j-1]-2x[j]+x[j+1] j=3...98; x3-x97+x98=3;
Df=1-2+1;}
cout<<x<<endl;
It's syntactically invalid.

http://www.cplusplus.com/doc/tutorial/
Topic archived. No new replies allowed.