Which code segment should you use?

You are developing an application that will process orders. The debug and release versions of the application
will display different logo images. You need to ensure that the correct image path is set based on the build
configuration. Which code segment should you use?

You are developing an application that will process orders. The debug and release versions of the application
will display different logo images. You need to ensure that the correct image path is set based on the build
configuration. Which code segment should you use?

A.
#if (DEBUG)
imgPath = “TempFolder/Images/”;#elif (RELEASE)
imgPath = “DevFolder/Images/”;
#endif

B.
if (DEBUG)
imgPath = “TempFolder/Images/”;
else
imgPath = “DevFolder/Images/”;
endif

C.
#if (DEBUG)
imgPath = “TempFolder/Images/”;
#else
imgPath = “DevFolder/Images/”;
#endif

D.
if(Debugger.IsAttached)
{
imgPath = “TempFolder/Images/”;
}
else
{
imgPath = “DevFolder/Images/”;
}

Explanation:
There is no such constraint (unless you define one explicitly) RELEASE. http://stackoverflow.com/
questions/507704/will-if-release-work-like-if-debug-does-in-c



Leave a Reply 0

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