A

Admin • 833K Points
Coach

Q. What is the correct syntax to access a static member of a class?

Code:
class A
{
public:
static int val;
}
  • (A) A->val
  • (B) A.val
  • (C) A::val
  • (D) A^val
  • Correct Answer - Option(C)
  • Views: 20
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

The scope resolution operator :: is used to access a static member of a class.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.