What Are The Differences Between A C++ Struct And C++ Class?
Answer Posted / shalesh kumar
The default member and base-class access specifies are different.
This is one of the commonly misunderstood aspects of C++. Believe it or not, many programmers think that a C++ struct is just like a C struct, while a C++ class has inheritance, access specifies, member functions, overloaded operators, and so on. Actually, the C++ struct has all the features of the class. The only differences are that a struct defaults to public member access and public base-class inheritance, and a class defaults to the private access specified and private base-class inheritance.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are function prototypes?
What are smart pointers?
What data encapsulation is in c++?
Is c++ a low level language?
What is ifstream c++?
What are the advantages and disadvantages of B-star trees over Binary trees?
Is string data type in c++?
What is a type library?
How do you add an element to a set in c++?
How does a copy constructor differs from an overloaded assignment operator?
What is the iunknown interface?
Write about the retrieval of n number of objects during the process of delete[]p?
Write a program which employs Recursion
What are stacks? Give an example where they are useful.
What is a unnitialised pointer?