Code:
struct element{
int data_int;
char data_char;
struct element* next;
}
stack_t;
This structure is used for pushing data onto the stack..., the whole idea of my peek function, is that I get all the data off the stack without deleting any of it.
Main function ::
Code:
int main(int argv, char*argc[])
{
int a,b,c,d,i,k;
char q,r,s,t;
printf("Enter any 4 integers and 4 chars seperated by spaces ");
scanf("%d %d %d %d %c %c %c %c", &a,&b,&c,&d,&q,&r,&s,&t); //Read in user
push(a,q,&stack);
push(b,r,&stack);
push(c,s,&stack);
push(d,t,&stack);
for (i=0; i > 4 ; i++)
{
test[i] = peek(&stack,i);
}
}