What is the difference between Class and Structure?

Answer Posted / ali abbas khan

structure is contain data member and class is contain member function
structure have by default public and class have by default privat
structure can't have inheritance and class can have inheritance

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can I use a forward declaration?

626


What are the different types of comments allowed in c++?

581


How do I use turbo c++?

552


Define virtual constructor.

641


Where can I run c++ program?

605






Explain unexpected() function?

586


Differences between private, protected and public and give examples.

579


What is the difference between a reference and a pointer?

601


What is vector string in c++?

578


Explain the difference between static and dynamic binding of functions?

557


How come you find out if a linked-list is a cycle or not?

573


What does extern mean in a function declaration in c++?

706


Can member functions be private?

602


What do you mean by funtion prototype?

592


Define a constructor - what it is and how it might be called (2 methods)?

606