![]() ![]() ![]() Function-like macros can be defined to accept arguments, so that they look and act like function calls. In practical terms, there are two types of macros. The process of replacing a macro call with the processed copy of the body is called expansion of the macro call. If the macro accepts arguments, the actual arguments following the macro name are substituted for formal parameters in the macro body. The macro name is replaced by a copy of the macro body. ![]() When the name of a macro is recognized in the program source text, or in the arguments of certain other preprocessor commands, it's treated as a call to that macro. In this preprocessor documentation, only the term "macro" is used. Identifiers that represent statements or expressions are called macros. Identifiers that represent constants are sometimes called symbolic constants or manifest constants. The #define directive is typically used to associate meaningful identifiers with constants, keywords, and commonly used statements or expressions. They test a constant expression or identifier to determine which text blocks to pass on to the compiler, and which ones to remove from the source file during preprocessing. Conditional compilation directives allow you to suppress compilation of parts of a source file. It expands macros in parts of some directives that aren't skipped as part of a conditional compilation. The preprocessor expands macros in all lines except preprocessor directives, lines that have a # as the first non-white-space character. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |