0

I sometimes wish they would have kept some features from c++ in C#. Anyways, I was trying to try an old c/c++ trick:

#define SUM 1

but it does not work in c#. Anybody know how to declare symbols in c#?

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by sid78669
0

In C# there is no separate preprossesing step like in C or C++.
#define looks like in C/C++ but it's not all the same.
You can use it for conditional compilation like:
#define DEBUG

and then
#if DEBUG
bla bla
#else
blo blo

0

does this mean that the following lines are possible:

#define DEBUG

#if DEBUG
    return 1;
0

I meant to ask can i return an integer value if Debug comes up? if yes, then how??

0

Your code must be ended with #endif directive, my first example was not complete, sorry for that.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.