Stack implementation using arrays
First of all, I would specify that your stack is using a "dynamically allocated array", as opposed to just an array, as I at first expected a C array when looking at the title.  That varies from person to person, though.

On to more important things:


I would not print anything in the stack functions.  If someone wants information on what they're pushing and popping, let them do it themselves.
You seem to be missing a peek function.
Either throw an exception or add an assert to pop for the array_ == last_ case.
length_ should actually be called capacity_.
expandArray may leak memory if the copy throws.  I would use an std::vector&lt;T*&gt; internally for this stuff.
You don't check that length &gt; 0 in the constructor.
I would not allocate so anything by default.
You lack all three of a copy constructor, assignment operator, and destructor, so you'll definitely leak memory.  You should also have a move constructor and a move assignment operator, but those aren't as critical.
You provide no way to check whether the stack is empty.