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 / jammu hari cell:9848278041

Difference between class & Structure is :-
-------------------------------------------

1. class = data + functions
structure=Collection of different data
2. Class supports Re-usability. Structures are used to handle
the complex data.
3. Both are user defined data types.
4. 'struct' is a keyword which is used to declare a structure.
'class' is a keyword used to declare a class.
5. By default all the structure members are public. But in
class all the members are private.
6. Structure variable is used to access the structure
members. Object is used to access the class members.
7. Structure is less secure than the class.
8. Structure is a procedure Oriented feature. Object is a
Object Oriented Feature.
9. Both Structure & Class uses (.) dot operator to access
their members.
10. class contains 3 access specifiers But structure has
only 1 access specifier.
11. We can inherit a class. But we can't inherit structure.
12. We can declare constructors & destructors inside of a
class. But we can't declare these in Structure.

Is This Answer Correct ?    20 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a sequential access file?

1041


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1071


What is the difference between void main and main in c?

1096


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2812


largest Of three Number using without if condition?

1527


What does %p mean c?

1016


How do you search data in a data file using random access method?

1255


Explain how can I right-justify a string?

991


What is the meaning of typedef struct in c?

1004


Is fortran still used today?

1041


Hi can anyone tell what is a start up code?

2000


What is the heap in c?

1030


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

3206


What is unary operator?

1051


When should the volatile modifier be used?

1107