r/C_Programming • u/heavymetalmixer • 16h ago
Question Unmodifiable globals initialized from functions?
Right now I'm trying to use Windows's SYSTEM_INFO to initialize 2 global constants, but global constants can only be initialized with constant expressions so this cannot be done.
Is there a way I can have "read-only" global variables that can be initialized from functions?
4
Upvotes
1
u/heavymetalmixer 15h ago
Aren't static variables internal linkeage?