I'm having a hard time trying to decipher this problem after several hours of research.

[Linker error] undefined reference to `averageNums(int*, int, double&)'
ld returned 1 exit status

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778`` ``````// This program demonstrates an array being passed to a function. #include #include using namespace std; void showValues(int [], int); // Function prototype void inputValues(int[], int); void highestLowest(int[],int); void averageNums(int[],int,double&); int main() { double average; const int ARRAY_SIZE = 10; int numbers[ARRAY_SIZE]; inputValues(numbers, ARRAY_SIZE); showValues(numbers, ARRAY_SIZE); highestLowest(numbers, ARRAY_SIZE); averageNums(numbers, ARRAY_SIZE,average); system ("pause"); return 0; } void showValues(int nums[], int size) { cout<>nums[index]; cout < highest) highest = nums[count]; } //lowest int lowest; lowest = nums[0]; for (count = 1; count < size; count++) { if (nums[count] < lowest) lowest = nums[count]; } cout <<"Values used range from "<
Line 9:
 `` `` ``void averageNums(int[],int,double&);``

Line 70:
 `` `` ``void averageNums(int nums[], int size,double avg)``

In the forward. the third argument is double by reference. In the implementation, it is passed by value. As far as the linker is concerned, these are two different functions. A forward declaration and it's implementation must match exactly.
Wow, thank you very much for your help.....a second set of eyes was a great help.

~Eric
Topic archived. No new replies allowed.