Segmentation Fault when trying to push element into stack from a switch case menu
Recently in our data structures course , we have been introduced to the stack and had the task of implementing one with a switch case menu in an infinite loop . This should have been easy but using dynamic memory allocation , I kept running into this segfault while pushing elements in the stack which I detected with the help of the VS Code debugger.