#include #include "mydefs1b.h" void main() { Istack s1; // a stack of integers Cstack s3; // a stack of chars int i; s1.init(500); s3.init(); // default size of 100 for( i = 0; i < 20; i++ ) { s1.push(i); // also push(s1, i); } for( i = 0; i < 20; i++ ) { cout << s1.pop() << ' '; } cout << endl; for( i = 0; i < 20; i++ ) { s3.push('a' + i); // overloading push } for( i = 0; i < 20; i++ ) { cout << s3.pop() << ' '; } cout << endl; } /* 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 t s r q p o n m l k j i h g f e d c b a */