Question: In C++ a. What is the main difference between a struct and a class? b. Explain why you would need both public and private members

In C++
a. What is the main difference between a struct and a class?
b. Explain why you would need both public and private members in aclass.
c. What is a constructor? Why would you include a constructor in aclass?

Step by Step Solution

3.55 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Soln What is the main difference between a struct and a day ... View full answer

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 Programming Questions!