I can not figure out how to check the stack for emptiness: ...

struct List { int x; //информационный элемент List *Next; }; bool Empty(List *&p) { if (p == NULL) { return true; } else { return false; } } 

...

  • In this case, it’s not a fact that there will be null, you need a stack depth counter, which is incremented when adding an element, and decremented when deleting, though if you have a lot of flow version, you need to perform these operations atomically - Alexsandr Ter
  • Through equality to null pointer and check. - insolor

0