+ 10
how does a static variable in c work? What is the advantage of using this variable?
4 ответов
+ 10
Static Variable has a property of preserving their value even after they are out of scope, static variable can preserve its value in their previous scope and can be used again without initialized again. actually static is a key word used for storage classes.
Reference:
https://www.youth4work.com/Talent/C-Language/Forum/118628-what-is-the-use-of-static-variable-in-c
+ 4
Static variables are initialized one time only. a static variable can preserve its value in their previous scope and can be used again without initialized again.
a static variable is used for a fixed value in your project like college name is same for all page so college name is declared as static.
0
Hauar you