{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

All it does is print numbers out to the shell console

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , and then proceed with the pushing only if it is not full. Otherwise, simply return false and terminate the function without doing anything. Think about how you would check for that. Once you have established that the stack is not full, you should set the appropriate value in the array equal to the input parameter n. Don’t forget to update the size variable as well. What do you think should happen to it? And once you’ve done all your stuff, don’t forget to return true as well. Task 3 – Popping function int pop(int arr, int &size); This function should pop the number last pushed onto the stack, and then return it. If the stack was already empty, then the function should return - 1. Remember, your stack only contains non- negative...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online