What i am trying to do is pass an array of structs to a function.
the code i have so far follows:
struct Contribution
{
string name;
double amount;
};
const int MAX = 25;
typedef Contribution BigSpender;
typedef BigSpender ContributionRec[MAX];
const string NAME_FILE = "names.txt";
const string CONTRIBUTION_FILE = "slush.txt";
void InitProgram( BigSpender ContributionRec[MAX] );
int main()
{
InitProgram( ContributionRec[MAX] );
return 0;
}
void InitProgram( BigSpender& ContributionRec[MAX] )
{
return;
}
Can anyone tell me what I am doing wrong?