Can static variables be declared in Header file in C Programming Language?


Can static variables be declared in Header file in C Programming Language?


We can not declare a static variable without defining it. We can declare static variables in header file when their definition should also be provided in the same header file. It is generally an idea to use static variables in the header file but it creates some problem that it makes the static variables as a private copy of header file i.e it can not be used elsewhere. 



No comments:

Post a Comment