That is because output function takes 10 parameters, but you passed 6 instead.
From your code, it is clearly shown that
r is an array. Therefore, the
output function could look like this instead:
1 2 3 4 5 6
|
double output( int r[], int const &size_of_r, int const & gainmain ){
std::cout << "Actual gain = " << gainmain << std::endl;
for ( int i = 0; i != size_of_r; ++i ){
std::cout << "R" << i + 1 << " = " << r[i] << " kohm" << std::endl;
}
}
|
I'm assuming R1 to R4 is contained in array
r. Otherwise, r1s...r4s in the output parameters are redundant.
EDIT: If you really want to use that design and pass r1 to r4 explicitly to
output, then you should 100% sure that they are valid subscript in r, otherwise you could be in a little trouble.You should be careful not to pass any value that are larger than the size of
r