I'm implementing a linked list program in C and the create_node function gives a warning: function returns address of local variable. I've read about using malloc, but I'd like to understand what the original problem and solution would be without it. Thanks.
struct list_node_s* Create_node(int val, struct list_node_s* node_p) {
struct list_node_s temp;
temp.data = val;
temp.next_p = node_p;
return &temp;
} /* Create_node */