书上的例子,为什么gcc编译不了?
这是徐士良书上的例子,见附件,怎么gcc编译不成功?求助各位。
12CPLX0.rar
(1.81 KB)
编译后提示:12CPLX0.C:4:16: error: 'x' was not declared in this scope
12CPLX0.C:4:18: error: 'n' was not declared in this scope
12CPLX0.C:4:19: error: expression list treated as compound expression in initializer [-fpermissive]
12CPLX0.C:5:3: error: expected ',' or ';' before 'int'
12CPLX0.C:6:11: error: expected initializer before '*' token
12CPLX0.C:7:3: error: expected unqualified-id before '{' token
12CPLX0.C:15:14: error: variable or field 'cplxs' declared void
12CPLX0.C:15:14: error: 'n' was not declared in this scope
12CPLX0.C:15:16: error: 'm' was not declared in this scope
12CPLX0.C:15:18: error: 'x' was not declared in this scope
12CPLX0.C:15:20: error: 'c' was not declared in this scope
12CPLX0.C:15:22: error: 'd' was not declared in this scope
12CPLX0.C:15:24: error: 'w' was not declared in this scope
12CPLX0.C:18:3: error: expected unqualified-id before '{' token
12CPLX0.C:25:2: error: expected unqualified-id before '{' token
12CPLX0.C: In function 'int cplx(int, int, double*, double*, double, double, double*, double*, int, void (*)(int, int, double*, double*, double*, double*), double (*)(d
ble*, int))':
12CPLX0.C:48:30: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
12CPLX0.C:49:30: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
12CPLX0.C:50:30: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
12CPLX0.C:51:31: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
12CPLX0.C:52:31: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
12CPLX0.C: In function 'int main()':
12CPLX0.C:178:50: error: cannot convert 'double (*)[4]' to 'double*' for argument '8' to 'int cplx(int, int, double*, double*, double, double, double*, double*, int, vo
(*)(int, int, double*, double*, double*, double*), double (*)(double*, int))'