class function assigned to zero?

What does it means when a class function equals zero:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
template <class xtyp_state> 
class CStates
{

	CStates(void);

public:
	
	~CStates(void);
	//This is called when the state is entered
    virtual void Enter(xtyp_state*)=0;
	
	//This is called regularly once the state is entred
	virtual void Execute(xtyp_state*)=0;
	
	//This is called when the state is exited
	virtual void Exit(xtyp_state*)=0;

};

#endif 
Those are pure virtual functions, and what it means is that any classes derived from CStates MUST overload Enter, Execute and Exit. It also makes CStates an abstract class, so you cannot create an instance of the class, only classes derived from it which overload the pure virtual functions. Basically abstract classes are designed specifically to be base classes and nothing more.
Last edited on
the "=0" means this function is a pure virtual function,
any class that includes at least one pure virtual function ,it becomes a abstract class ,which can not instantiated ,just can be the base class .
:)
Topic archived. No new replies allowed.