我在使用这段代码返回错误时遇到了麻烦:
assgTest2.c: In function 'Integrate':
assgTest2.c:12: warning: initialization makes pointer from integer without a cast
assgTest2.c:15: error: expected ';' before ')' token
Run Code Online (Sandbox Code Playgroud)
我已经环顾四周,无法理解类似问题的答案,任何帮助都将不胜感激.
1 void SamplePoint(double *point, double *lo, double *hi, int dim)
2 {
3 int i = 0;
4 for (i = 0; i < dim; i++)
5 point[i] = lo[i] + rand() * (hi[i] - lo[i]);
6 }
7
8 double Integrate(double (*f)(double *, int), double *lo, double *hi, int dim,
9 double N)
10 {
11 …Run Code Online (Sandbox Code Playgroud)