I keep getting this error
error C2601: 'find_ave_bal' : local function definitions are illegal
that is pointing to this code
Code: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; } }
and this is the code that comes directly before it
Code://display output in table form cout<<"ID Number"<<setw(16)<<"Balance"<<setw(20)<<"Difference from Average"<<endl; for ( ID[j] = 0; ID[j] < n; ID[j] = ID[j] + 1) { cout<<setw(4)<<ID [j]<<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint) <<setw(16)<<bal<<setw(20)<<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint) <<find_ave_bal (ID [j], num_bal)<<endl; } return 0; }
I can't seem to figure out why I am getting this error. It is the only error I am getting at this point and so far, everything that I have tried has not worked. Thanks in advance for any help![]()
GrlNewB



LinkBack URL
About LinkBacks



