Which code should you use?

You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode.
If the application is compiled in Release mode, the console output must display Entering release
mode.
Which code should you use?

You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode.
If the application is compiled in Release mode, the console output must display Entering release
mode.
Which code should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
Programmatically detecting Release/Debug mode (.NET)
Boolean isDebugMode = false;
#if DEBUG
isDebugMode = true;
#endif
http://stackoverflow.com/questions/654450/programmatically-detecting-release-debug-mode-net



Leave a Reply 7

Your email address will not be published. Required fields are marked *

sixteen − five =


Mawe

Mawe

A similar quest implies that there is no such constraint as RELEASE (unless explicitly defined by the user). Hence the RELEASE branch should never pass. What is different here?

Artem

Artem

If you see syntax highlighting in B answer, TRACE is defined for current buid settings. May be B then?

Artem

Artem

Sorry, no. TRACE exist for Release too.

123

123

No correct answer

Begia

Begia

there is no one correct answer

Lord Vader

Lord Vader

the question doesnt imply release is defined. if not there is no correct answer.