Q:

Why static functions cannot access non-static variables in c++?

0

Why static functions cannot access non-static variables?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Because a static function by definition is not tied to any single object of the class, while non-static variables always refer to an actual object in some way.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is a dangling pointer in c++?... >>
<< What is a Memory Leak?...