Tried functor and function pointer to implement stack, all failed. Opverloaded operator > at last, which works.