区分Debug版还是Relase版
生活随笔
收集整理的這篇文章主要介紹了
区分Debug版还是Relase版
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
// test.cpp : 區(qū)分Debug版還是Relase版
//
#include "stdafx.h"
//提示使用Debug環(huán)境會(huì)定義宏_DEBUG
int _tmain(int argc, _TCHAR* argv[])
{
#ifndef _DEBUG
#define N "Relase版"
#else
#define N "Debug版"
#endif
?? ?char a[10] = N;
?? ?printf("%s\n",a);
?? ?return 0;
}
//
#include "stdafx.h"
//提示使用Debug環(huán)境會(huì)定義宏_DEBUG
int _tmain(int argc, _TCHAR* argv[])
{
#ifndef _DEBUG
#define N "Relase版"
#else
#define N "Debug版"
#endif
?? ?char a[10] = N;
?? ?printf("%s\n",a);
?? ?return 0;
}
總結(jié)
以上是生活随笔為你收集整理的区分Debug版还是Relase版的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: extern C的作用
- 下一篇: 如何检查Socket是否断开