I was on a middle on making my code then I encountered this
Code:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct stackNode
{
int data;
struct stackNode *nextPtr;
};
typedef struct stackNode StackNode;
typedef StackNode *StackNodePtr;
void instructions();
void push(StackNodePtr *, int);
int main()
{
instructions();
getch();
}
void instructions()
{
printf("Please enter a choice\n");
printf("[1]Push a value on the stack\n");
printf("[2]Pop a value off the stack\n");
printf("[3]Display the whole stack\n");
printf("[4]Exit");
}
void push (StackNodePtr *topPtr, int info)
{
StackNodePtr newPtr;
newPtr = malloc(sizeof (StackNode));
if(newPtr !=NULL)
{
newPtr->data=info;
newPtr->nextPtr=*topPtr;
*topPtr = newPtr;
}
}
I am not yet but when I compiled it there's an error popping it help please