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

Which c++ operator cannot overload?

918


What is difference between data abstraction and encapsulation?

1031


Why is c++ still used?

1007


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

1074


How static variables and local variablesare similar and dissimilar?

993


Why do we need oop?

1101


Why ctype h is used in c++?

907


By using c++ with an example describe linked list?

977


Discuss the role of C++ shorthands.

914


Write a c++ program to display pass and fail for three student using static member function

3323


What do you mean by function and operator overloading in c++?

990


What is purpose of abstract class?

1015


explain the term 'resource acquisition is initialization'?

887


What do you mean by public protected and private in c++?

997


Explain some examples of operator overloading?

1031