Okay this is a really dumb question but I can't seem to come up with a satisfactory way to do the following.
I need a (preferably constant) variable accessible to my entire C++ project. That is, I have many .cpp files that need to use the same variable. I've tried all kinds of combinations of extern, #define, static (within the best class to dump them in), separate files to only define them, etc that I've found around the internet and nothing has worked. The ideal solution would be have a header file that I could just #include wherever I needed access to the variables. This should be simple, but for some reason how to do this is escaping me right now.
Thanks in advance!
I need a (preferably constant) variable accessible to my entire C++ project. That is, I have many .cpp files that need to use the same variable. I've tried all kinds of combinations of extern, #define, static (within the best class to dump them in), separate files to only define them, etc that I've found around the internet and nothing has worked. The ideal solution would be have a header file that I could just #include wherever I needed access to the variables. This should be simple, but for some reason how to do this is escaping me right now.
Thanks in advance!