Originally Posted by
MK27
var1 and var2 should be local to push().
"stack" is maybe what most people would call "head", except your pop() function is wrong -- it will just go thru the whole list (not pop one item at a time off), and you will lose a pointer to your first element (which was in "stack", ie, the head), so you will now have no way to access the list.
The normative way would be to declare the head in main and then use an initialize function. You should find a link list tutorial and use that. You must have these basics in order before you have a hope of sorting.