My main.cpp includes the header file setup.h.
setup.h reads data from a file, which is then used in main.cpp.
In the data file which setup.h reads, one piece of data is a single float variable, which I need to use in a function (from another header file) in main.cpp.
I can't use extern when defining the variable in my header file, because then I can't initialize it with the data from the file (gives an error when compiling):
setup.h
...
extern float G = 0;
input >> G;
...
main.cpp
...
float G;
instance function(G);
...
How do I get the initialized variable in my main.cpp file?