Question: What happens to the implementation of a class if we redefine a data member? For example, suppose we have Does the representation of a bar

What happens to the implementation of a class if we redefine a data member? For example, suppose we have

class foo { public: int a; char *b; }; class bar : public foo { public: float c; int b; };

Does the representation of a bar object contain one b field or two? If two, are both accessible, or only one? Under what circumstances?

class foo { public: int a; char *b; }; class bar : public foo { public: float c; int b; };

Step by Step Solution

3.28 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

If you redefine a data member in a derived class it will hi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Language Pragmatics Questions!