stack3 - } Using Stack Class in C++ void main() { Stack S;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Using Stack Struct in C void main() { Stack S; Stack_Init(&S); Stack_Push(&S, 30); Stack_Push(&S, 40); printf("Top: %d\n", Stack_Top(&S)); Stack_Pop(&S); printf("Top: %d\n", Stack_Top(&S)); Stack_Pop(&S); printf("Top: %d\n", Stack_Top(&S));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } Using Stack Class in C++ void main() { Stack S; S.Push(30); S.Push(40); printf("Top: %d\n", S.Top()); S.Pop(); printf("Top: %d\n", S.Top()); S.Pop(); printf("Top: %d\n", S.Top()); }...
View Full Document

This note was uploaded on 12/14/2011 for the course EECS 6.837 taught by Professor Durand during the Fall '03 term at MIT.

Ask a homework question - tutors are online