apstack - Last Revised abort changed to exit(1 comments...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// ******************************************************************* // Last Revised: 8/18/98 // abort() changed to exit(1) // comments updated // // September 1, 1997 -- APCS stack class IMPLEMENTATION // // stack implemented using the APCS vector class // ******************************************************************* / #include "apstack.h" #include <stdlib.h> # const int SDEFAULT_SIZE = 10; // default initial stack size c template <class itemType> apstack<itemType>::apstack( ) : myTop(-1), myElements(SDEFAULT_SIZE) // postcondition: the stack is empty { } template <class itemType> : myTop(s.myTop), myElements(s.myElements) // postcondition: stack is a copy of s { } template <class itemType> apstack<itemType>::~apstack() // postcondition: stack is destroyed { // vector destructor frees memory } template <class itemType> // postcondition: normal assignment via copying has been performed
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/20/2011 for the course COMPUTER 12 taught by Professor Aymanboghdady during the Spring '11 term at American College of Computer & Information Sciences.

Page1 / 3

apstack - Last Revised abort changed to exit(1 comments...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online