The new, more general, template class looks much the
same, but with the addition of |
||||||||||||||||
Stack<int> Istack; Stack<double> Dstack; Stack<char> Cstack; Stack<Map*> Mstack; |
|
|||||||||||||||
And for the push operation we would need something like: |
||||||||||||||||
Istack.push(10); Dstack.push(3.4); Cstack.push('x'); |
|
|||||||||||||||
Thus from this you can see that C++ is quite a big and powerful language, which should lead to smaller, easier to debug and maintain programs! You now have enough to handle Assignment 3, though I am sure that you will find Allen Supynuk's online notes most helpful, since there you will find some worked examples. |
||||||||||||||||
March 14, 1998 |
Page 4 |
C201/TAM |