I'd like to conditionally exclude/include code based on whether I'm building in debug mode.
Can I use something as simple as a #ifndef _DEBUG
as I would in C++?
\r is known as carriage return. \r is used in C language to move the cursor to the beginning of the current line that you are working on.
Compared to C++, C is the simpler and ultimately faster programming language. C is procedural and does not support classes and objects, meaning it has less functionality than C++. This allows you to spend more time focusing on what you can do with C's libraries, especially at the OS level.
The bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. If both bits are 1, the bit is set to 1. Otherwise, the bit is set to 0.
In most C compilers, including ours, the newline escape sequence '\n' yields an ASCII line feed character. The C escape sequence for a carriage return is '\r'.
#if DEBUG Console.WriteLine("Debug version"); #endif #if !DEBUG Console.WriteLine("NOT Debug version"); #endif
See this.
#if !DEBUG // whatever #endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With