#define ?

J

Jon Skeet

Steven Blair said:
Does C# have something similar to #define (C/C++)

Well, that depends entirely on what you want it to do. You can use it
for conditional compilation, but you can't use it for macros, constants
etc.

For constants, you should use const variables, and for macros you
should just use methods.
 
J

Jasper Kent

Note the slight syntax differences from C++ too:

The #define statements have to be the first thing in the file and the
conditional is simply #if, not #ifdef or #if defined.

Jasper Kent
 

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

Similar Threads

Using a MFC dll in C# 1
Passing a string br reference from c# to c++ 1
Serial Port 2
FTP in C# 5
ResourceManager 1
Progress Bar 1
#define in C# 3
Excel VBA 1

Top