home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH15 / A15092.TXT < prev    next >
Encoding:
Text File  |  1993-09-29  |  533 b   |  10 lines

  1. Consider a stack as an example of an abstract data type.  A stack
  2. must have methods for pushing an item onto the stack and for
  3. popping an item off the stack.  These methods do not depend on the
  4. type of each item in the stack.  In C++, you can define a class
  5. template that implements several stacks.  Similarly, a single
  6. algorithm for sorting elements in an array can be used for arrays
  7. of different types.  In C++, you can declare a function template
  8. for a blueprint sort function that can handle arrays of different
  9. types.
  10.