What is the difference between Class and Structure?
Answer Posted / eshetu
1. IN STRUCTURE THE DATA MEMBER BY DEFAULT IS PUBLIC BUT IN
CLASS THE DATA MEMBER ARE PRIVATE.
2. THE STRUCTURE ONLY CONTAIN DATA MEMBER BUT CLASS CONTAIN
DATA MEMBER & MEMBER FUNCTION.
3.IN STRUCTURE THE STRUCTURE NAME CAN'T STAND ALONE.BUT THE
CLASS NAME CAN STAND ALONE.
Is This Answer Correct ? | 10 Yes | 5 No |
Post New Answer View All Answers
What is #include cstdlib in c++?
Can class objects be passed as function arguments?
What does flush do c++?
Explain the operation of overloading of an assignment operator.
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
What does it mean to declare a member function as virtual?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
What is const in c++?
Is there a sort function in c++?
Why the usage of pointers in C++ is not recommended ?
What is virtual destructor ans explain its use?
Is map thread safe c++?
What is time_t c++?
Can you please explain the difference between using macro and inline functions?
why and when we can declar member fuction as a private in the class?