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


Please Help Members By Posting Answers For Below Questions

What is #include cstdlib in c++?

656


Can class objects be passed as function arguments?

601


What does flush do c++?

551


Explain the operation of overloading of an assignment operator.

694


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?

999






What does it mean to declare a member function as virtual?

583


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

540


What is const in c++?

596


Is there a sort function in c++?

545


Why the usage of pointers in C++ is not recommended ?

892


What is virtual destructor ans explain its use?

601


Is map thread safe c++?

628


What is time_t c++?

606


Can you please explain the difference between using macro and inline functions?

525


why and when we can declar member fuction as a private in the class?

1600