Your Ad Here
0

Can static variables be declared in a header file ?

Posted by The Blogger on 8:59 AM in
Answer:

You can’t declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.

tags: c interview questions and answers, c interview question Can static variables be declared in a header file, Can static variables be declared in a header file, static variables, header file

0 Comments

Post a Comment

Your Ad Here

Copyright © 2009 Interview Questions and Answers