Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Class and Structure?

Answer Posted / p govind rao

1) structure :- In structure have a by default public.
In class have a by default private.
2) Structure cannot be inherited. But class can be
inherit.
3) There is no data hiding features comes with
structures. Classes do, private, protected and public.
4) A structure can't be abstract, a class can.
5) A structure is a value type, while a class is a
reference type.
6) A structure is contain only data member , but class
contain data member and member function.
7) In a Structure we can't initilse the value to the
variable but in class variable we assign the values.
8) Structure are value type, They are stored as a
stack on memory. where as class are reference type. They
are stored as heap on memory.

Is This Answer Correct ?    597 Yes 96 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

1138


Why is main function important?

1116


What is a namespace in c++?

2041


What is string in c++ programming?

1200


What does the ios::ate argument do?

1190


Explain rethrowing exceptions with an example?

1032


What are the general quetions are in DEna bank manager IT/System interviews?

2023


What are the advantages of c++? Explain

1066


Can we inherit constructor in c++?

1101


What information can an exception contain?

1146


Describe delete operator?

1101


What does h mean in maths?

1228


What are the advantages of using pointers in a program?

1146


Can member functions be private?

1010


How do I use arrays in c++?

1011