-5

My questions is: if a static variable (access level: private) is defined in a class and we want to access it by non static function of that class. . is it possible in c++?

1
  • 4
    Have you tried to do this? It would take less effort than this post. live link: godbolt.org/g/U4291s Commented May 23, 2018 at 20:14

1 Answer 1

0

The answer is yes.

This question was already somewhat asked here: Can non-static methods modify static variables

You are just asking if it can access it though - I am fairly certain if you can modify something, that means you can also access it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.