home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_04
/
1004090d
< prev
next >
Wrap
Text File
|
1992-02-10
|
484b
|
26 lines
main()
{
int size = 50;
int vali = 10;
long vall = 456789;
double vald = 123.456;
stack3.pstack = malloc(size * sizeof(double));
if (stack3.pstack == NULL) {
printf("Can't allocate space for stack3\n");
exit(1);
}
stack3.max_stack = size;
push(&stack1, &vali);
push(&stack2, &vall);
push(&stack3, &vald);
printf("stk1: %d\n", *((int *)pop(&stack1)));
printf("stk2: %ld\n", *((long *)pop(&stack2)));
printf("stk3: %f\n", *((double *)pop(&stack3)));
return 0;
}