I am getting an unresolved external error when compiling the code, and i cannot figure out what the issue is. I am pretty positive that the template and functions are being used and created according to the assignment, but i just cannot get it to compile. Any help on the matter would be greatly appreciated .H
#pragma once
#include<iostream>
using namespace std;
template <class P>
class Pair
{
private:
P firstLetter;
P secondLetter;
public:
Pair(const P&, const P&);
P getSecondLetter();
P getFirstLetter();
};
template <class P>
P Pair<P>::getFirstLetter()
{
return firstLetter;
}
template <class P>
P Pair<P>::getSecondLetter()
{
return secondLetter;
}
Main: #include
#include "Pair.h"
using namespace std;
int main()
{
Pair<char> letters('a', 'd');
cout << "\nThe first letter is: " << letters.getFirstLetter();
cout << "\nThe second letter is: " << letters.getSecondLetter();
cout << endl;
system("Pause");
return 0;
}