谁能帮我解决下面代码中显示的错误?
#include <iostream>
#include "FG.h"
struct pr { double (*fG[3]) (double, double, double, double*);};
int main()
{
double (*fG[3]) (double, double, double, double*);
fG[0] = GX00;
fG[1] = GX00;
fG[2] = GX22;
double prx[2] = {10, 1};
struct pr params ={ fG };
std::cout << params.fG[0]( 1 , 0.5 , 1, prx ) << std::endl;
return 0;
}
编译:
$ g++ -c test.cpp
test.cpp:在函数'int main()'中:test.cpp:15:25:错误:数组必须用大括号括起来的初始化程序初始化