Hi all, How do you #define (as in C++) in C#? Many thanks, James
T Tom Spink Sep 30, 2005 #2 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
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