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 Are The Differences Between A C++ Struct And C++ Class?

Answer Posted / shalesh kumar

The default member and base-class access specifies are different.

This is one of the commonly misunderstood aspects of C++. Believe it or not, many programmers think that a C++ struct is just like a C struct, while a C++ class has inheritance, access specifies, member functions, overloaded operators, and so on. Actually, the C++ struct has all the features of the class. The only differences are that a struct defaults to public member access and public base-class inheritance, and a class defaults to the private access specified and private base-class inheritance.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you call C functions from C++ and vice versa?

1163


What is the highest level of cohesion?

1037


Differentiate between an array and a list?

1172


Is string an object in c++?

1147


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2583


How does a C++ structure differ from a C++ class?

1116


Can a function take variable length arguments, if yes, how?

1006


What do you understand by a pure virtual member function?

1003


What are the uses of c++ in the real world?

1028


what are Access specifiers in C++ class? What are the types?

1218


How would you differentiate between a pre and post increment operators while overloading?

1139


What is rtti in c++?

1134


Define 'std'.

1173


Explain what is oop?

1065


Explain the advantages of inheritance.

1141