Class Problem

I'm creating a class and a user defined library and also creating a text file. I tried to call the functions but having lots of errors. Here is the program:

#ifndef MYLIB
#define MYLIB

template <class THREE, int n>
class THREE
{
private : struct RECORD
{
string name;
int age;
float gpa;
};
RECORD a[n];

public:
void CopyData ("three.txt");
void DisplayAll();
int FindAgeAverage();
void FindGpaAve(float & GpaAve);
void DisplayAverage(ageAve, GpaAve);
void DisplayAbove(GpaAve);
~ THREE()
};


template <int n>
void THREE <int n> ::CopyData( "three.txt", a 7)
{


for (int i=0; i<n; ++i)
f>> x[i].name >> x[i].age >> x[i].gpa >> endl;


}

void THREE <int n> ::DisplayAll()
{

for (int i=0; i<n; ++i)
cout << x[i].name << '\t'
cout << x[i].age << '\t'
cout << x[i].gpa << '\t'
cout << endl;

}

int THREE <int n> ::FindAgeAverage ("three.txt")
{
float age1, age2, age3, age4, age5, age6, age7, average;
average = (age1 + age2 + age3 + age4 + age5 + age6 + age7)/ 7;
}






void THREE <int n> ::FindGpaAverage( float & Gpaave)
{
float gpa1, gpa2, gpa3, gpa4, gpa5, gpa6, gpa7, gpaAverage;
gpaAverage = (gpa1 + gpa2 + gpa3 + gpa4 + gpa5 + gpa6 + gpa7)/ 7;
}



void THREE <int n> ::DisplayAverage(ageAve, GpaAve)
{
cout << "Their age average is :" << average << endl;
cout << "Their Gpa average is :" << gpaAverage << endl;
}
void THREE <int n> ::DisplayAbove(GpaAve)
{
for (int i=0; i<n; ++i)
cout << "This is the name of those with GPA above average" << n[i] << endl;
}

#endif


#include<iostream>
#include<fstream>
#include<string>
#include "MYLIB.h"

using namespace std;


int main()
{
ifstream inFile;
inFile.open("three.txt");


THREE <int, 7> p;
p.CopyData();
p.DisplayAll();
p.FindAgeAverage ();
p.FindGpaAve();
p.DisplayAverage();
p.DisplayAbove();
system ("pause");
inFile.close();
return 0;
}


I don't use templates, but from what I remember, you cant name your class after your template class.
Topic archived. No new replies allowed.