Tuesday, March 17, 2009

C# language's Preprocessor directives?

The C# language's preprocessor directives are as follows:
�#if
�#else
�#elif
�#endif
�#define
�#undef
�#warning
�#error
�#line
�#region
�#endregion

Main use of directives are:
1.Conditional compilation. Using special preprocessing directives, you can include or exclude parts of the program according to various conditions.

2.Line control. If you use a program to combine or rearrange source files into an intermediate file, which is then compiled, you can use line control to inform the compiler of where each source line originally came from.

3.Error and Warning reporting. The directive `#error' causes the preprocessor to report a fatal error and the directive `#warning' is like the directive `#error', but causes the preprocessor to issue a warning and continue preprocessing.
Ref : http://www.csharphelp.com/archives/archive36.html

No comments: