I have the following code
When I try to do the following:-
I get the above warning.
Code:
typedef struct _DoublyLinkedNode {
int value;
struct _DoublyLinkedNode *next;
struct _DoublyLinkedNode *prev;
}DoublyLinkedNode;
typedef struct DoublyLinkedList {
int size;
struct DoublyLinkedNode *firstnode;
struct DoublyLinkedNode *lastnode;
}list;
list *p;
int main(){
p = (list*)malloc(sizeof(list));
DoublyLinkedNode *node;
node = (DoublyLinkedNode*)malloc(sizeof(DoublyLinkedNode));
node->value = 7;
node->next = NULL;
node->prev = NULL;
/*
The other code belongs here.
*/
return 0;
}
Code:
p->firstnode = &node;
Comment