What is the difference between Class and Structure?

Answer Posted / swetcha

The difference between a class and a structure is that, by
default, all of the members of a class are private and, by
default, all of the members of a structure are public.

Is This Answer Correct ?    797 Yes 102 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

602


Can a program run without main?

613


Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

623


Name the operators that cannot be overloaded in C++?

574


Does c++ have a hash table?

530






Explain about Virtual Function in C++?

597


What is function overriding in c++?

589


Can a program run without main function?

606


What data encapsulation is in c++?

580


Which c++ operator cannot overload?

537


What is a modifier in c++?

619


Does a derived class inherit or doesn't inherit?

610


How can we read/write Structures from/to data files?

610


Mention the ways in which parameterized can be invoked.

529


What is a literal in c++?

555