home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH15 / A15092.WAV (.mp3) < prev    next >
Waveform Audio File Format  |  1993-11-01  |  386.1 KB  |  1 channel  |  11,025 sample rate  |  36 seconds
Transcription: Consider a stack as an example of an abstract data type. A stack must have methods for pushing an item onto the stack and for popping an item off the stack. These methods do not depend on the type of each item in the stack. In C++, you can define a class template that implements several stacks. Similarly, a single algorithm for sorting elements in an array can be used for arrays of different types. In C++, you can declare a function template for a blueprint sort function that can handle arrays of different types.