Hi can you help me. I was assigned to create a stack in c++ and my professor asked to put arrays inside each stack. how do i do that?

We don't do your homework for you. Try to solve the homework problem and if you are still having difficulties then post your code here.

Welcome to Daniweb.

Please note that the first part of any solution process is to get a clear and complete understanding of the problem.

So, are you sure of:

... I was assigned to create a stack in c++ and my professor asked to put arrays inside each stack ... ?

Note: It is quite common to 'use an array' as the container for a 'stack'.

Note too that a C++ vector container is really just an easily expandable dynamic array that has added push_back, (read) back and pop_back methods (functions).

So ... since a stack is a LIFO (last in first out) type of container structure ... any container that has 'push_back', '(read) back' and' pop_back' methods (functions) could be used for a stack ... (and/or push_front, (read) front, pop_front).

This is why a C++ list is also often used as a container to code a stack.

Make you best efforts to code a solution to your problem ... but firstly ... make sure that you have a clear and complete statement of that problem.

If you need help to understand that 'statement' ... you will also need to include the exact statement of the problem as it was given.

vector<array<type> > mystack_of_arrays;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.