// @topic W10-2-010 IntStack class using dynamic array v2
// @brief main driver program using IntStack class

#include <iostream>
#include <cstdlib>
#include "int_stack.h"

IntStack create_stack()
{
    return IntStack();
}

void use_stack( IntStack const& st )
{
    IntStack st2 = st; // deep copy
    IntStack st3;      // default ctr
    st3 = st3; //self-assgnm
    st3 = st;
    st3.operator=( st );
}

int main()
{
    IntStack st = create_stack();
    //std::cout << "top of st: " << st.top() << "\n";

    // stack operations demo:
    st.push( 11 );
    st.push( 22 );
    st.push( 33 );
    st.push( 44 );
    use_stack( st );

    st.push( 55 );

    std::cout << "top of st: " << st.top() << "\n";
    std::cout << "size of st: " << st.size() << "\n";

    st.pop();

    while ( st.size() > 0 ) {
        st.pop();
    }

    system("pause");
    return 0;
}
