Can static variables be declared in a header file?
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.
Showing Answers 1 - 6 of 6 Answers
- Extracting characters and mathematical computation
- Rollup process
- Identify the mistake
- .Rec file not created
- Host file access
- Test scenarios for view functinality
- Copy of file in gde
- Variables storage
- Email validation via cobol
- Split a 10 gb file into 10 files of 1 gb
- Find corrupted record in multifile
- Modify record in multi-file
- Find corrupted record in a multi file
- Chicken and egg
- Hard or soft mount
- Product testing on various versions of hardware.
- Seperate header & tailer & body
- Static/global variable
- Extracting from rows
- Filter out errors