Crazy error about architecture

I'm working on a program for class, and I'm getting an error message that I don't understand at all. My TA doesn't understand it either.
Here's the message:
Undefined symbols for architecture x86_64:
  "readFile(char, int&)", referenced from:
      _main in ccIjftP3.o
  "computeAverage(int*, int, double)", referenced from:
      _main in ccIjftP3.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status


And here's my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <fstream>
using namespace std;
int *readFile (char, int&);
double computeAverage (int*, int, double);
int main ()
{
    char fileName [20];
    double sum=0;
    int SIZE=0;
    cout << "Input file name: ";
    cin >> fileName;
    int *intptr;
    intptr=readFile (fileName[20], SIZE); 
    cout << "Number of students: " << endl;
    cout << "Total number of movies watched by students: " << sum << endl;
    cout << "Average number of movies watched by students: " << computeAverage(intptr, SIZE, sum) << endl;
}
int *readFile (char fileName[], int &SIZE)
{
    ifstream inFile;
    inFile.open (fileName);
    if (!inFile) 
    {
        cout << "Error opening file." << endl;
    }
    inFile >> SIZE;
    int *ptr;
    int num;
    ptr=new int [SIZE];
    for (int i=0; i<SIZE; i++) 
    {
        inFile >> num;
        *(ptr+i)=num;
    }
    
}
double computeAverage (int *intptr, int SIZE, double &sum)
{
    double average;
    for (int i=0; i<SIZE; i++) 
    {
        sum+= *(intptr+i);
    }
    average=sum/SIZE;
    return average;
}


My TA thinks it's something to do with my computer, not my code. Any help is greatly appreciated!!
It's definitely your code.

Your prototypes and your function bodies don't match.

Look carefully
1
2
3
4
5
6
7
int *readFile (char, int&);
double computeAverage (int*, int, double);

// vs

int *readFile (char fileName[], int &SIZE)
double computeAverage (int *intptr, int SIZE, double &sum)
Thank you so much!
You're very welcome.
Topic archived. No new replies allowed.