Brushing up on linked lists.
I'm detecting a memory leak coming from this function.
I know I can't delete the variable foo without corrupting the data.
How can I get rid of the memory leak?
void push_front( struct node*& head, int data )
node* foo = new node ;
foo->data = data ;
foo->next = head ;
head = foo ;
//delete foo ;