Stacks in C++ ... Such a class would not allow us to place a stack of integers and a stack of characters into the same program, for example. There is a way in C++ to create a more generic stack type that would let us create such different stacks within the same program.