In C/C++ project, where to define the global variables is a question. If you define them in the header file, you may encounter the link2005 error about objects redefined.
The formal way to define global variables is to define them in C or CPP file, and declare them in the header file by using extern keyword.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment