What is the difference between Class and Structure?

Answer Posted / sharad

in c++ structure and class are same. we can use the
structure in place of class for creating the object. but
the difference is only the default access specifier of the
class is private and public of the structure.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where the memory to the static variables is allocated?

562


Why struct is used in c++?

627


How do you master coding?

570


What are the data types in c++?

523


What does catch(…) mean?

616






What is while loops?

622


Describe the setting up of my member functions to avoid overriding by the derived class?

616


How are virtual functions implemented in c++?

605


What are the advantages of c++?

600


What is math h in c++?

609


How can you differentiate between inheritance and implementation in c++?

646


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2203


Difference between overloading vs. Overriding

594


Can non-public members of another instance of the class be retrieved by the method of the same class?

612


What is set in c++?

662