[C++] Stack using Array

Questions about programming languages and debugging
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[C++] Stack using Array

Post by ayu »

A stack class using dynamically allocated arrays. This was only made to show that it can be done and how, because usually you don't want to use arrays to create a stack, due to the ineffectiveness when the array has to resize, and it might take up un-needed memory. There is an upside to it though, that you can use the index of an array to access to elements easier. This class is a template class, meaning that are not restricted to one data type ;)

Enjoy ^^

Stack.h

Code: Select all

http://code.suck-oold.com/139
There are some minor statements in the code that might change, and I will update the thread in case of any change :)
"The best place to hide a tree, is in a forest"

Post Reply