How do you "#define" in C#?

T

Tom Spink

Hi James,

The #define statement in C# is only used for defining symbols that can be
tested for existence with the other preprocessor directives, #if and #elif.

That is to say, you cannot use #define in the same way as C++. In C#, it is
only used to define a symbol used in preprocessor conditionals.

Please see the following article for a (probably better) description of
#define, in C# (URL may wrap):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfdefine.asp

-- Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top