Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribed

(there's some code inbetween)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago