Question: Working in c++, I'm having a hard time understanding how classes work. Below are some pictures of my code. In the main function (second picture)

Working in c++, I'm having a hard time understanding how classes work.

Below are some pictures of my code. In the main function (second picture) I need to make function calls to functions that are inside the class "Stack" but as my code is right now, the main function doesn't seem to know the contents of Stack. On line 111 (second picture) I declare the object for Stack class, does this only make my main function aware of the constructor function in Stack and not my other functions? How do I use other functions within the class? (on line 131, I try to use the "push" function but it doesn't work) Thanks!

Working in c++, I'm having a hard time understanding how classes work.

(there's some code inbetween)

Below are some pictures of my code. In the main function (second

23 24 25 26 27 28 29 30 31 32 class Stack private: int top; int a[ MAX]; public: Stack(int, int) 34 35 36 37 38 39 40 41 top EMPTY_STACK INDEX; void display() for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!