C | Storage Classes and Type Qualifiers | Question 12

In C, static storage class cannot be used with:
(A) Global variable
(B) Function parameter
(C) Function name
(D) Local variable


Answer: (B)

Explanation: Declaring a global variable as static limits its scope to the same file in which it is defined.
A static function is only accessible to the same file in which it is defined.
A local variable declared as static preserves the value of the variable between the function calls.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up