C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - Yes / No Questions (Q.No. 3)
3.
Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.
Yes
No
Answer: Option
Explanation:
The only way this can be achieved is to define the variable locally in main() instead of defining it globally and then passing it to the functions which need it.
Discussion:
11 comments Page 2 of 2.

Tamizharasi said:   1 decade ago
What about using static keyword? I think we can achieve it.


Post your comments here:

Your comments will be displayed after verification.