Could anyone help me solve the error shown in the code below?
#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;
}
compile:
$ g++ -c test.cpp
test.cpp: In function ‘int main()’: test.cpp:15:25: error: array must be initialized with a brace-enclosed initializer