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!
(there's some code inbetween)
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; iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started