struct Contribution
{
string name;
double amount;
};
const int MAX = 25;
typedef Contribution BigSpender[MAX];
const string NAME_FILE = "names.txt";
const string CONTRIBUTION_FILE = "slush.txt";
void InitProgram( BigSpender& ContributionRec );
int main()
{
BigSpender ContributionRec;
InitProgram( ContributionRec );
return 0;
}
void InitProgram( BigSpender& ContributionRec )
{
return;
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
delete lines 9 and 10 because that doesn't work, and replace it with just this one line
typedef Contribution BigSpender[MAX];
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Are all the typdef's really needed? I find it hard to follow the bouncing, er, whatever.
struct Contribution
{
string name;
double amount;
};
const int MAX = 25;
const string NAME_FILE = "names.txt";
const string CONTRIBUTION_FILE = "slush.txt";
void InitProgram( Contribution contrib[] );
int main()
{
Contribution ContributionRec[MAX];
InitProgram( ContributionRec );
return 0;
}
void InitProgram( Contribution contrib[] )
{
return;
}
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228