Hi,
I want to use a variable in two files in an application that i am writing.
What would you suggest is the saftest way to do this, should i:
a). Define it in one of the files it will be used in and then use the
keyword to make it accessible in the other file.
b). define it in a header file and then include the header file in both the files i want to use the variable in
If you can give any suggestions on the best way to accomplish the latter, that would be appreciated.
All suggestions and reasons welcomed.
Thanks in advance for your time.
I want to use a variable in two files in an application that i am writing.
What would you suggest is the saftest way to do this, should i:
a). Define it in one of the files it will be used in and then use the
Code:
extern
b). define it in a header file and then include the header file in both the files i want to use the variable in
If you can give any suggestions on the best way to accomplish the latter, that would be appreciated.
All suggestions and reasons welcomed.
Thanks in advance for your time.
Comment