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
Is c++ a good beginners programming language?
Which is most difficult programming language?
What is the difference between malloc, calloc and realloc?
How the keyword struct is different from the keyword class in c++?
What are dynamic type checking?
Are there interfaces in c++?
What character terminates all character array strings a) b) . c) END
How to declare a pointer to an array of integers?
Can circle be called an ellipse?
What is the difference between reference and pointer?
What is iostream in c++ used for?
Why c++ is called oop?
Explain virtual inheritance?
What do you mean by ‘void’ return type?
Please explain class & object in c++?