What is the difference between global and static global variables?
belongs to collection: C interview questions, your interviewer might ask
All Answers
total answers (1)
belongs to collection: C interview questions, your interviewer might ask
total answers (1)
Answer:
Global and static global variables have different linkages. It is the reason global variables can be accessed outside of the file but the static global variable only accesses within the file in which it is declared.
A static global variable ===>>> internal linkage.
need an explanation for this answer? contact us directly to get an explanation for this answerA non-static global variable ===>>> external linkage.