In C++:
* use 0 instead of NULL; use nullptr if C++11 or better.
* use new instead of malloc
* use references instead of passing an address
* don't say "struct Node" when making a Node; just say "Node"
* Use a "constructor" to create objects
The following is only a taste of what you could do.
@Manga, good point. I totally forgot about that.
A dtor would need to work recursively (and not using tail-recursion, either), which I don't like for a list (what if it had millions of elements?) so I suppose a delete_list function is best. It's still very C-like, though. A C++ list would have a List object to hold the nodes. I don't know how far the OP wants to go. He seems to really only know C (and not much of that).
1
2,1 //push 2, new node, node -> next = head, head = new ... no loop to find end
3,2,1 ...
making pop just tmp = head, head = head-> next, delete tmp, no loop to find end
and so on.
You are making your code slower AND more complex to write.