What is the difference between Class and Structure?

Answer Posted / navin

Structure: Initially (in C) a structure was used to bundle
different type of data types together to perform a
particular functionality. But C++ extended the structure to
contain functions also. The major difference is that all
declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all
the members inside the class are private.

Is This Answer Correct ?    182 Yes 55 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is recursion?

642


What can I use instead of namespace std?

629


What is the latest version on c++?

671


write a porgram in c++ that reads an integer and print the biggest digit in the number

1755


Is ca high or low level language?

570






Explain function overloading

576


What do you mean by const correctness?

617


What is the difference between prefix and postfix versions of operator++()?

580


What do the keywords volatile and mean mutable?

593


What are the rules for naming an identifier?

547


Differentiate between a template class and class template in c++?

616


What is a class template in c++?

509


What is using namespace std in c++?

593


Should the member functions which are made public in the base class be hidden?

551


What is the full form nasa?

585