I defined a linked list in C++. I am trying to set a NULL value to the variable head (in the constructor of Movie_LinkedList
), but I got:
movie.h(40): error C2065: 'NULL' : undeclared identifier
please note that I can't include any library except of iostream
#define NAME_LEN 100
class Movie_DataBase
{
private:
long int m_Code;
char m_Name[NAME_LEN];
bool belongs_to_netwroks[2];
public:
Movie_DataBase();
Movie_DataBase(char movie_name[],long int movie_code);
};
class Movie_LinkedList
{
private:
class Movie_Node
{
public:
Movie_DataBase* data;
Movie_Node* prev;
Movie_Node* next;
public:
Movie_Node();
};
Movie_Node* head; //pointer to the first node in the linkedlist
int a;
public:
void set_movie();
Movie_LinkedList() { head = NULL; }
};
Any help appreciated!
NULL
hasn't been defined. Either define it or sethead = 0
– Equerry