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...

Difference between Class and Struct.

Answer Posted / naresh kukreti

The struct default access type is public. A struct should
typically be used for grouping data.

The class default access type is private, and the default
mode for inheritance is private. A class should be used for
grouping data and methods that operate on that data.

In short, the convention is to use struct when the purpose
is to group data, and use classes when we require data
abstraction and, perhaps inheritance.

In C++ structures and classes are passed by value, unless
explicitly de-referenced. In other languages classes and
structures may have distinct semantics - ie. objects
(instances of classes) may be passed by reference and
structures may be passed by value.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe dynamic data structure in c programming language?

1097


Can we change the value of static variable in c?

1033


What are the back slash character constants or escape sequence charactersavailable in c?

1184


What is the difference between char array and char pointer?

1058


How to write a code for reverse of string without using string functions?

2147


What is a pointer variable in c language?

1106


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

1379


How does sizeof know array size?

1123


Can you please explain the difference between malloc() and calloc() function?

1122


Can a variable be both const and volatile?

1132


What are the advantages of external class?

1071


how can I convert a string to a number?

1084


What is putchar() function?

1163


what are non standard function in c

1914


What are called c variables?

1065