pointers_variables - printf("Top: %d\n",...

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

View Full Document Right Arrow Icon
Pointers to Objects void main() { Stack *S = new Stack(); S->Push(30); S->Push(40); printf("Top: %d\n", S->Top()); S->Pop(); printf("Top: %d\n", S->Top()); S->Pop();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("Top: %d\n", S->Top()); delete S; } Variable Declarations void main() { int a; a = 10; Stack S; for (int i=0; i<a; i++) S.Push(i); }...
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