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

 
Output of file : 1004094B contained in archive : CUJ9204.ZIP

void push1(int value)
{
if (stack_ptr1 > stack_ptr2)
printf("Stack 1 is full\n");
else
stack[stack_ptr1++] = value;
}

void push2(int value)
{
if (stack_ptr1 > stack_ptr2)
printf("Stack 2 is full\n");
else
stack[stack_ptr2--] = value;
}

int pop1(void)
{
if (stack_ptr1 == 0) {
printf("Stack 1 is empty\n");
return 0;
}

return stack[--stack_ptr1];
}

int pop2(void)
{
if (stack_ptr2 == STACK_SIZE - 1) {
printf("Stack 2 is empty\n");
return 0;
}

return stack[++stack_ptr2];
}

void dump_stack(void)
{
int i;

printf("Stack contains: ");
for (i = 0; i < STACK_SIZE; ++i)
printf("%4d", stack[i]);

printf("\tsp1 = %lu, sp2 = %lu\n",
(unsigned long)stack_ptr1, (unsigned long)stack_ptr2);
}



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

  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/