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

I dont have much programming experience. Is this the way to print the elements in the stack?

#define STACK_SIZE 5

int stack[STACK_SIZE]; // initialise the array

void print(int stack[])
{
 int count;

    for (count = 0; count < sizeof(stack); count++)
    {
       printf("%d ", stack[count]);
    } // end for
} // print




George N. Bilios
__________________
gbilios
Reply With Quote