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
Why the usage of pointers in C++ is not recommended ?
What is the use of endl in c++?
Is c++ a low level language?
Why oops is important?
What are the types of pointer?
Do you know about latest advancements in C++ ?
What are the five basic elements of a c++ program?
Write syntax to define friend functions in C++.
How a modifier is similar to mutator?
What is the difference between object-oriented programming and procedural programming?
What is operators in c++?
What is polymorphism and types?
What is a stack c++?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
what is data encapsulation in C++?