Here is my code and and I'm having problem on main.cpp
on line cout << amarmatha.sub<int>(55,5)<<endl;
caculator.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#ifndef CACULATOR_H
#define CACULATOR_H
template<class T>
class caculator
{
public:
caculator();
T sub (T x, T y);
T multiply (T x, T y);
T divide (T x, T y);
virtual ~caculator();
protected:
private:
};
#endif // CACULATOR_H
caculator.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "caculator.h"
template<class T>
caculator<T>::caculator()
{
//ctor
}
template<class T>
T caculator<T>::sub(T x, T y)
{
return x-y;
}