Ho un problema con questo struct contructor quando provo a compilare questo codice:Perché NULL non è dichiarato?
typedef struct Node
{
Node(int data) //
{
this->data = data;
previous = NULL; // Compiler indicates here
next = NULL;
}
int data;
Node* previous;
Node* next;
} NODE;
quando vengo questo errore si verifica:
\linkedlist\linkedlist.h||In constructor `Node::Node(int)':|
\linkedlist\linkedlist.h|9|error: `NULL' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|
Ultimo problema era la struct, ma ha funzionato bene quando era nel mio main.cpp, questa volta è in un file di intestazione e mi sta dando questo problema. Sto usando Code :: Blocks per compilare questo codice
NULL fa parte di stddef.h, non stdlib.h – awiebe