A

Admin • 833K Points
Coach

Q. Which of the following is the correct syntax to declare a static variable in C++?

  • (A) int static a;
  • (B) static int a;
  • (C) static a int;
  • (D) int a static;
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

In C++, a static variable is declared using the 'static' keyword followed by the data type, like 'static int a;'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.