189. this Pointer

Question.1

A constructor parameter shadows a member variable:

class Servo {
   int pos;
public:
   Servo(int pos) {
       pos = pos;  // Line A
   }
};

Servo s(90);

After construction, what is s.pos? (Assuming public access.)

Need Help? Refer to the Quick Guide below

Select Answer