我已经编写了几个只有方法定义的类,以及下面的这些方法声明。在底部我有main()
功能。
我想问你两个问题——包括这个在内的最佳做法是什么,我应该怎么做?
#include <iostream>
#include <cstdlib>
#include <fstream>
using namespace std;
template <class heap> class Addition {
protected:
heap a;
heap b;
heap outcome;
public:
Addition(heap, heap);
}; // End Addition
template <class heap> Addition::addition(heap c_a, heap c_b)
{
a = c_a;
b = c_b;
}
template <class heap> class Array_Addition: public Addition {
public:
solve();
}; // End Array_Addition
template <class heap> Array_Addition::solve()
{
// something here
}
template <class heap> class Struct_Addition: public Addition {
public:
solve();
}; // End Struct_Addition
int main()
{
cout << "aaaaa";
return 0;
}