-
Question About Headers
I am making my own header file to use for my program.. Can I initialize my variables to be used by the program in my header. Instead of listing every variable in every .cpp is it possible to just include the header with all this info already in it? Thanks in advance.
-
What sort of variables? It's better that header files are left to the definition of things that are used throughout your program, while source files are left to their implementation.
>> Instead of listing every variable in every .cpp
In what case are you facing is this necessary? If they are merely things like const's and #define's, then certainly it could be appropriate.
-
OH, ok, because in the program I a writing I have about 20 array variables and 15 non arrays, and I have to put them in EVERY single one of my .cpp, but I am using my header to init all the other headers like iostream, conio,time, and windows.h, and was wondering if there is a way around putting all those variables in each .cpp like in a header or somthing but from what you say you cant.
EDIT: I am really new to the programming thing so I dont know all the rules.