InterviewSolution
Saved Bookmarks
| 1. |
Can Static Variables Be Declared In A Header File? |
|
Answer» You can't DECLARE a static variable without DEFINITION (this is because they are mutually EXCLUSIVE STORAGE classes). A static variable can be defined in a header file, but then EVERY source file with in that scope will have their own copy of this variable, which is intended. You can't declare a static variable without definition (this is because they are mutually exclusive storage classes). A static variable can be defined in a header file, but then every source file with in that scope will have their own copy of this variable, which is intended. |
|