A

Admin • 833K Points
Coach

Q. What does the 'static' keyword do when applied to a local variable inside a function?

  • (A) Makes the variable accessible from other files
  • (B) Ensures the variable retains its value across function calls
  • (C) Limits the variable's scope to the entire program
  • (D) Creates a constant variable
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

A 'static' local variable retains its value across multiple function calls.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.