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

What is meant by the term name mangling in c++?

961


Can a new be used in place of old mallocq? If yes, why?

1096


In a function declaration what does extern means?

1052


Is dev c++ free?

1046


What will happen if a pointer is deleted twice?

1183


Can a destructor be called directly?

1076


Difference between a copy constructor and an assignment operator.

1002


what type of question are asked in thoughtworks pair programming round ?

2217


Why do we use templates?

1058


What exactly is polymorphism?

1130


What is a sequence in c++?

1017


What is the use of 'using' declaration in c++?

1141


What is static class data?

1061


What is the difference between multiple and multilevel inheritance in c++?

1132


What is the use of endl in c++ give an example?

1171