Question about dynamic memory allocation
Hi guys , i have a question about din. memory alloc. and i want to ask it with an example.
What if i did not write the np=malloc(sizeof(struct node)); line, Does the code work properly ? When i need to take a place from memory using with pointer and when i dont need ? Thank you for your answers.
/* here is my struct */
struct node *next;
/* here is my simple making node function*/
struct node *makenode(int value)
struct node *np;