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 / guest

(1)Class Design For Object , Struct Design For Value Thus
Class is Refrence Type (Heape) but Struct is Value Type
(Stack) And Thus Struct is Faster Than Class ,

(2) Class is not Accessable Meanning We Can Access it By
Object , Struct is Accessable Meanning We Can Access it By
Value (Varible).

(3) Class Support Inheritance , Struct Not Support Inheritance .

(4)Class id Added Behavior (Methods) , Struct Not Added
Behavior

(5)Class Exist at higher Level of the Program , Struct Exist
at Lowest Level of the Program .

(6) A struct cannot declare a default constructor (a
constructor without parameters) or a destructor.Class Can .

(7)a small class may be more efficiently handled by the
system if you declare it as a struct instead.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is new in c++?

1153


What do you mean by vtable and vptr in c++?

1100


What is auto type c++?

1170


How many types of modularization are there in c++?

1120


Why c++ is not a pure oop language?

1093


Write about an iterator class?

1131


How can you quickly find the number of elements stored in a static array?

1137


What is an undefined reference/unresolved external symbol error and how do I fix it?

1166


What does the nocreate and noreplace flag ensure when they are used for opening a file?

1174


What are the main features of c++?

1052


Explain the difference between realloc() and free() in c++?

1072


Which operator cannot overload?

1101


Tell me an example where stacks are useful?

1098


Explain the pure virtual functions?

1171


What are pointer-to-members? Explain.

1223