S

Shiva Ram • 30.44K Points
Instructor I

Q. Which of the following is the correct way to define a static member variable in C++?

  • (A) static int x;
  • (B) int static x;
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(C)
  • Views: 43
  • Filed under category C++

Explanation by: Shiva Ram
Both 'static int x;' and 'int static x;' are valid ways to define a static member variable in C++.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics