1.

What functions are a static variable visible to?(a) Only Static Functions(b) All Types of Functions(c) Only Functions with a return type(d) Only Non Static FunctionsI have been asked this question during an interview for a job.My question comes from Variable Scope and Qualifiers topic in division Arduino Programming of Arduino

Answer»

Right ANSWER is (a) Only STATIC Functions

To explain: The static keyword makes the VARIABLE only visible to one function. The DATA HELD by static variables is not erased when the function call is over. This is what differentiates any static variable with a non-static variable.



Discussion

No Comment Found

Related InterviewSolutions