Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>#define macro definition</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
#define                  Macro Definition

 #define identifier [text]
or
 #define identifier([arg1, arg2, ..., argn]) [text]

    There are two forms of the #define directive. The first defines a
    manifest constant (commonly called a macro):

          #define identifier [text]

    The second form defines a macro with arguments:

          #define identifier([arg1, arg2, ..., argn]) [text]

      Notes:    Once a macro has been defined, it cannot be redefined
                with a different value without its definition first being
                removed with #undef.

                'text' can be any arbitrary text. If it is omitted the
                macro is still considered to be defined. In the argument
                form, the text usually includes all of the identifiers in
                the argument list, although it need not.

                When macros are expanded, identifiers within literal
                strings or character constants are not replaced.

                The macro definition can be continued across multiple
                source lines by terminating each continued line with a
                backslash (\).

                You may need to parenthesize text to maintain the desired
                precedence when the macro is expanded.

                Arguments with side effects may cause undesirable results
                when the expanded code is compiled.

                Do not place any white-space between the macro name and
                the left parenthesis that begins the formal argument
                list.

                The number of arguments in a macro call must be the same
                as that in the macro definition.

                The maximum size of a macro definition is 512 bytes.

                The maximum number of actual macro arguments is eight.

                The maximum length of an actual macro argument is 256
                bytes.

                Macros can also be defined using the compile-time switch
                /D.

See Also: #undef

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson