struct stack /* Global structure to create a node*/
{ int data; struct stack *next; };
struct stack *push(struct stack *h,int d)
{ struct stack *p,*tmp; p=(struct stack *)malloc(sizeof(struct stack)); //creating a new node if(p==NULL) printf("\n\tStack Overflows."); else { p->data=d; //putting data into new node p->next=h; //making new node point to null h=p; } return h; }