Home »

In C, what is the difference between a static variable and global variable?

Question ListCategory: cIn C, what is the difference between a static variable and global variable?
jully882 author asked 1 year ago
1 Answers
ethanbrown author answered 1 year ago

A static variable declared outside of any function is accessible only to all the functions
defined in the same file (as the static variable). However, a global variable can be accessed

by any function (including the ones from different files).

Please login or Register to Submit Answer