Youve already seen in your last lecture that a string

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: time to make a test case and thoroughly test your own code. Better you do it yourself that a TA during grading. The following is one test case which tests a few functionalities of your stack. Assume that the three stack functions are implemented below the main function. #include <iostream> using namespace std; const int capacity = 5; bool push(int st, int &size, int n); int pop(int st, int &size); void printStack(int st, int size); int main() { int stack[capacity]; int s = 0; for (int i=0; i<5; i++) { if (!push(stack, s...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online