πŸ“Š C++
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Ensures the variable retains its value across function calls

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

Explanation by: Ranjeet
A 'static' local variable retains its value across multiple function calls.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
107
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ranjeet
Publisher
πŸ“ˆ
95%
Success Rate