class Base
{
// your base class methods and data members
};
class Derived : public Base
{
// your derived class methods and data members
// derived can use the base class methods and data members.
};
When you get an error, copy and paste the error, please. Just saying "I have an error" is not very helpful.
Error C2955 'game': use of class template requires template argument list Project1 c:\programming\my projects\project1\project1\source.cpp 25
Error (active) E0441 argument list for class template "game" is missing Project1 c:\Programming\My Projects\Project1\Project1\Source.cpp 24
If you are required to use class templates:
https://stackoverflow.com/questions/8810224/inheriting-from-a-template-class-in-c
https://stackoverflow.com/questions/10758686/template-class-inheritance
#include "stdafx.h"
#include <iostream>
#include <fstream>
usingnamespace std;
template<class gamer>
template<class gamer> class game
{
private:
protected:
int nintendo;
int sega;
string fun;
bool enjoy;
public:
};
template<class gamer> class game2 : public game
{
private:
protected:
public:
};
Severity Code Description Project File Line Suppression State
Error C3857 'game': multiple template parameter lists are not allowed assignment2 abel c:\users\acmoo\source\repos\assignment2 abel\assignment2 abel\assignment2 abel.cpp 6
Severity Code Description Project File Line Suppression State
Error C2955 'game': use of class template requires template argument list assignment2 abel c:\users\acmoo\source\repos\assignment2 abel\assignment2 abel\assignment2 abel.cpp 22