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 do you mean by volatile and mutable keywords used in c++?

925


What is the difference between a reference and a pointer?

1041


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1227


Can non graphic characters be used and processed in C++?

1132


What is the difference between the functions rand(), random(), srand() and randomize()?

1192


What is lambda in c++?

1121


What are all predefined data types in c++?

1065


What is using namespace std in cpp?

1063


What is a container class? What are the types of container classes in c++?

1150


What is implicit conversion/coercion in c++?

1354


What is a memory leak c++?

1060


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

907


What are guid?

1178


What is pointer in c++ with example?

1006


What does the linker do?

982