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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B
Explanation: Both 'static int x;' and 'int static x;' are valid ways to define a static member variable in C++.
Explanation by: Shiva Ram
Both 'static int x;' and 'int static x;' are valid ways to define a static member variable in C++.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
131
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Shiva Ram
Publisher
πŸ“ˆ
99%
Success Rate