|ARM Technical Support Knowledge Articles|
Applies to: C Programming Language
Information in this article applies to:
I have a project that is composed of three source files. In one of my files, I #define a symbol. I want to access that symbol in the other source files but I receive an error indicating that the symbol is not defined.
#define is a preprocessor directive that allows you to specify a name and replacement text. As the preprocessor parses the source file, each occurrence of the name is replaces by its associated text.
The scope of #define is limited to the file in which it is defined. So, #defines which are created in one source file are NOT available in a different source file.
Typically, #defines which are shared between multiple files are stored in a header file (*.h) which is included in each source file that requires the #define.
Article last edited on: 2004-04-24 14:46:23
Did you find this article helpful? Yes No
How can we improve this article?