Mam problem z tym struct contructor gdy próbuję skompilować ten kod:Dlaczego NULL jest niezadeklarowany?
typedef struct Node
{
Node(int data) //
{
this->data = data;
previous = NULL; // Compiler indicates here
next = NULL;
}
int data;
Node* previous;
Node* next;
} NODE;
kiedy przyjdzie ten błąd:
\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 ===|
Ostatni problem to struktura, ale to działało dobrze, gdy to było w moim main.cpp, tym razem jest w pliku nagłówkowym i daje mi ten problem. Używam Code :: Blocks do kompilacji tego kodu
NULL jest częścią stddef.h nie stdlib.h – awiebe