dos_compilers/Mix C v251/EXAMPLES/EXAM73B.C

13 lines
403 B
C++
Raw Normal View History

2024-07-24 18:30:16 +02:00
main() /* Example 7.3 - part B */
{
int count; /* test push, pop, & top_reset */
int pop(),push(),stk_lst(),top_reset();
top_reset(); /* start off with fresh stack */
stk_lst(); /* see if stack is empty */
for(count=0; push(count)> -1; count++) ;
stk_lst(); /* list current contents */
while (pop() > -1);
stk_lst(); /* see if stack empty */
}