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

List some of the static data structures in C?

1164


What is sorting in c plus plus?

939


Is c is a middle level language?

1015


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1075


Differentiate between null and void pointers.

1126


How can I get the current date or time of day in a c program?

1176


What is memcpy() function?

1057


What is a void * in c?

1030


Why do we use stdio h and conio h?

1042


Explain what is a const pointer?

1043


Explain about the constants which help in debugging?

1321


Difference between linking and loading?

1067


What is "Duff's Device"?

1128


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1126


Explain how do you sort filenames in a directory?

992