Category : Files from Magazines
Archive   : CUJ9204.ZIP
Filename : 1004091B

 
Output of file : 1004091B contained in archive : CUJ9204.ZIP
void push(stack *st, void *pvalue)
{
if (st->stack_ptr == st->max_stack)
printf("Stack %s is full\n", st->stack_name);
else
switch (st->type) {

case INT:
((int *)st->pstack)[st->stack_ptr++] = *(int *)pvalue;
break;

case LONG:
((long *)st->pstack)[st->stack_ptr++] = *(long *)pvalue;
break;

case DOUBLE:
((double *)st->pstack)[st->stack_ptr++] = *(double *)pvalue;
break;
}
}

void *pop(stack *st)
{
if (st->stack_ptr == 0) {
printf("Stack %s is empty\n", st->stack_name);
return 0;
}

switch (st->type) {

case INT:
return &((int *)st->pstack)[--st->stack_ptr];
break;

case LONG:
return &((long *)st->pstack)[--st->stack_ptr];
break;

case DOUBLE:
return &((long *)st->pstack)[--st->stack_ptr];
break;
}
}



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9204.ZIP
Filename : 1004091B

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/