I am learning a book on data structures, and complied their node in linked list example, and I receive this error:
and Everything.cpp|7|error: expected unqualified-id before "int"|
and Everything.cpp|7|error: expected `)' before "int"|
||=== Build finished: 2 errors, 0 warnings ===|
The code for the node is:
typedef struct Node
{
struct Node(int data) //Compile suggest problem is here
{
this-> data = data;
previous = NULL;
next = NULL;
}
int data;
struct Node* previous;
struct Node* next;
} NODE;
I am not familiar with structs and I am using Code::blocks to compile. Does anyone know whats wrong?