Question: How can I push my student object onto my stack? My student class has different data types (string,int,string,int) for a student record. There are 15
How can I push my student object onto my stack? My student class has different data types (string,int,string,int) for a student record. There are 15 student records in an array and Id like to take those records and push them onto the stack. My thoughts are to use a for loop and simply say studentStack.push(studentRec[i]) and place the one record into one slot on the stack and the stackSize being the same size as the array.
Here is the staticStack class with member functions including my push function:

here is my push function:

And here is my student class and member functions:

class staticStack private: int *testscores; //Pointer to avg test scores iutmstackSizeu. int top; public: //Constructor taticStack(int); ICopy constructor staticStack (const staticStack &); //Destcuctoc staticStack(); //stack operations void push void pop (int &); bool isFull() const; bool isEmpty() const; 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
