i compiled the code you supplied. The code below:
printf("Debug: Number of elements in stack = %d\n\n",
sizeof(stack)/sizeof(stack[0]));
The code here does not display the number of elements in the array, but the actual limit of the array.
i integrated the code in my stack application and pushed some values. if i wanted to display the size of the stack i'll get 5, 'cos the stack size is set to 5. if i were to pop a value off the stack and then print, i can still see that value, why?
gbilios
George N. Bilios
|