← Quiz: C++ Classes and Objects: all 10 questions
Quiz: C++ Classes and Objects · Question 9 of 10
Why can a static member function not use non-static data members directly?
Why can a static member function not use non-static data members directly?
- A.Static functions cannot take parameters
- B.Non-static members are private
- C.It is called without an object, so it has no this pointer
- D.It runs before main starts
Answer & explanation
Correct answer: It is called without an object, so it has no this pointer
Non-static members belong to a particular object, and a static function is not tied to one.
Can you get the rest right without peeking?
Take the timed Quiz: C++ Classes and Objects quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →