When I try to run my program this error shows up "error C2955: 'FOURTEEN' : use of class template requires template argument list"
#include <iostream>
using namespace std;
template <class T, int n>
class FOURTEEN
{
private:
T a[n];
public:
void ReadData();
void DisplayData();
};
void FOURTEEN::ReadData()
{
for(int i=0;i<n;++i)
cin>>a.[i];
}
void FOURTEEN::DisplayData()
{
for(int i=0;i<n;++i)
cin>>a.[i]<<'\t';
cout<<endl;
}
int main()
{
FOURTEEN <int, 5>P;
//Read data into array a of object P
cout<<"Enter 5 numbers: ";
P.ReadData();
//display data of array a of object P
P.DisplayData();
system("pause");
return 0;
}
Do I have to retype template somewhere else?