Sponsored Ad

Wednesday, November 4, 2009

C# macros or a preprocessor

C # has no macros, as such, not strictly speaking have a pre-processor, but has no conditional compilation symbols that can be used to affect the compilation. These can be defined in the code or parameters for the compiler. The "pre-processing directives in C # (only the name of consistency with C / C + +, despite the absence of previously separate step in the process) are (text taken from the ECMA specification).

#define and #undef
Used to define and undefine conditional compilation symbols
#if, #elif, #else and #endif
Used to conditionally skip sections of source code
#line
Used to control line numbers emitted for errors and warnings.
#error and #warning
Used to issue errors and warnings.
#region and #endregion


Used to explicitly mark sections of source code.

0 comments:

Post a Comment

Sponsored Ad

Website Update

Followers