Possible Duplicate:
How to work with complex numbers in C?
So I have this piece of C code that compiles with errors saying that 'complex' does not name a type:
#include <stdio.h>
#include <complex.h>
#include <math.h>
int main ()
{
int B=9;
double theta;
double complex w;
float x,y;
x= 5*cos (theta) - 2;
y= 5*sin (theta);
double complex z=x+y*I;
w=z+(B/z);
for(theta=0;theta<=360;theta=+30)
{ printf ("%.2f %.2f %.2f %.2f",creal(z), cimag(z),y,creal(w), cimag(w));
printf ("/n");
}
return 0;
system ("pause");
}
I already include the <complex.h>
so why is there still an error for the 'complex'. There are also other errors, but let just focus on this one first.