Thread: Stacks
View Single Post
  #3 (permalink)  
Old March 21st, 2004, 12:21 AM
gbilios gbilios is offline
Authorized User
 
Join Date: Mar 2004
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote