I'm trying to understand how #if
statement works on C# and how it is used.
After reading some documentation, I have got to the conclusion that it is used to compile the code in it if the "symbol" in the condition is defined.
#if DEBUG
Console.WriteLine("Debug version");
#endif
The problem here is that I don't know what they mean by "symbol" (in this case, DEBUG
), and I'm struggling to find an answer due to the wide meaning of this word.
What are these "symbols" and what is the purpose of these "preprocessor directives"?