When I write this code, I get an error from my compiler saying that NULL is an undeclared identifier.
Code:
#ifndef DISK_H
#define DISK_H
class Disk
{
public:
Disk(int no) : number(no), next(NULL) {}
~Disk() {}
bool operator <(const Disk& rhs);
bool operator >(const Disk& rhs);
bool operator ==(int rhs);
int reveal_number()
{
return this->number;
}
private:
int number;
Disk* next;
};
#endif
I've also tried setting next equal to null inside the curly brackets instead, but that has the same problem. What's the problem?