Defines in C#

Originally I am from C++. I got really used to #define. Does this behavior carry over to C#


Answer this question

Defines in C#

  • Ollie Riches

    No. Preprocessor is pretty much gone from C#. Defines in C# are only good for conditional compilation.

    You can use external preprocessor if you want though.



  • Nick Waanders

    Thanks for the answers guys



  • DreamerZ

    For further reading on what Ilya said be sure to check out the MSDN page on the subject.

  • Defines in C#