0

If I apply static keyword to local variable, its value is maintained within function invocations. However, if I apply static keyword to global variable, will it be as good as declaring the variable as global? What I mean to say is does static keyword has any effect on global variables?

  • Global `static` variables (and functions) are local to the source file - they have internal linkage. – DeiDei Dec 13 '17 at 01:49

1 Answers1

1

It means that variable has file scope. You cannot access that global variable (by name) from another file.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Sudhee
  • 151
  • 4
  • 10