Subj : stack question...? To : borland.public.cpp.borlandcpp From : mujeebrm Date : Thu Sep 15 2005 10:54 pm /* prac2.c, n=size of stack, pc=push counter */ int *stk=0, n=0, pc=0; /* how can make my this simple stack implementation global variables free or more efficient */ initstk() { int x=0; printf("stack size ? "); scanf("%d", &n); if(n==0) { puts("stack size 0 entered!"); exit(1); } stk = malloc(n * sizeof(int) ); if(!stk) { puts("out a memory!"); exit(1); } for(x=0; x