Wow... that really helped my program!! Lol... only one error remains...
error C2601: 'find_ave_bal' : local function definitions are illegal
and it is pointing to my function:
Code:
//function to determine average balance
double find_ave_bal(int ID [], int num_bal)
{
double subtotal = 0;
double total;
for (int j = 0; j< num_bal; j++)
{
subtotal += ID [j];
}
total = subtotal / num_bal;
return total;
}
}
I tried putting the name "find_ave_bal" in my main program but got even more errors with that. I am still not sure why I am getting this error. When I call the function, I am calling it like this:
Code:
{
cout<<setw(4)<<ID + 1<<setprecision(2)
<<setiosflags(ios::fixed | ios::showpoint)
<<setw(16)<<bal<<setw(20)<<setprecision(2)
<<setiosflags(ios::fixed | ios:: showpoint)
<<find_ave_bal<<endl;
}
I was thinking... do I need to change the "find_ave_bal" to something like:
Code:
<<find_ave_bal (int, int)<<endl;
I am not really sure about that
[edit]
it seems like no matter what I do, I still keep getting the "local function definitions are illegal" error. I changed some things around and it didnt seem to fix it. Any ideas?