This is my code
I am expecting this line should print 2 but I don't get any valueCode:#include<stdio.h> #include<stdlib.h> struct node { int data; struct node * next; }; void ADD ( struct node *Head, int value) { struct node * new = malloc( sizeof(*new)); if ( new != NULL ) { new->data = value; new->next = NULL; } if ( Head == NULL ) { Head = new; } } int main () { struct node * head = NULL; ADD(head,2); printf("%d", head-> data ); return 0; }
Code:printf("%d", head-> data );