home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_04
/
1004090c
< prev
next >
Wrap
Text File
|
1992-02-10
|
321b
|
20 lines
void push(stack *st, int value)
{
if (st->stack_ptr == st->max_stack)
printf("Stack %s is full\n", st->stack_name);
else
st->pstack[st->stack_ptr++] = value;
}
int pop(stack *st)
{
if (st->stack_ptr == 0) {
printf("Stack %s is empty\n", st->stack_name);
return 0;
}
return st->pstack[--st->stack_ptr];
}