使得程序在Debug模式和Release模式下运行不同代码的方法

#ifdef _DEBUG


#else


#endif


// DebugRelease.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
#ifdef _DEBUG

	int i = 1;

#else

	int i = 0;

#endif


#ifdef _DEBUG

	int j = 10;

#else

	int j = 20;

#endif

	std::cout << (i+j);
	return 0;
}

猜你喜欢

转载自blog.csdn.net/u010440456/article/details/84817760