宏条件.......... [英] Macro Conditional..........

查看:71
本文介绍了宏条件..........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请任何人告诉我下面代码的重要性...


#if 0 / *这是什么用的macro conditional.since

这是每次都是假的。* /


stmt1;


#else


stmt2;


#endif

是否有任何理由在程序中包含上述宏条件?

Hi all,
Please can any one tell me the importance of below code...

#if 0 /*what is use of this macro conditional.since
this is every time false .*/

stmt1 ;

#else

stmt2;

#endif
Is it any reason to include above macro conditional in program ?

推荐答案

code break写道:
code break wrote:

大家好,

请允许任何人告诉我下面代码的重要性......


#if 0 / *这个宏条件的使用是什么。自

这是每次都是假的。* /


stmt1;


#else


stmt2;


#endif


是否有任何理由在程序中包含上述宏条件?
Hi all,
Please can any one tell me the importance of below code...

#if 0 /*what is use of this macro conditional.since
this is every time false .*/

stmt1 ;

#else

stmt2;

#endif
Is it any reason to include above macro conditional in program ?



是的,这很简单y使一段代码无效


#if 0

//这里的所有代码都将失效(不活动)

//如果有#else子句则会被验证

#endif

Yes, it is an easy way to invalidate a block of code

#if 0
// All code here will be invalidated (not active)
// If there is an #else clause it will be validated
#endif


code break写道:
code break wrote:

请允许任何人告诉我下面代码的重要性...


#if 0 / *这个宏条件的使用是什么.since

这是每次都是假的。* /

stmt1;

#else

stmt2;

#endif


是否有任何理由在程序中包含上述宏条件?
Please can any one tell me the importance of below code...

#if 0 /*what is use of this macro conditional.since
this is every time false .*/
stmt1 ;
#else
stmt2;
#endif

Is it any reason to include above macro conditional in program ?



有人想要有一些编译时选项。这个想法是你在某些代码中坚持使用你想要在特定情况下测试的代码,

可能用于调试目的。


它可能不推荐用于生产代码,但是如果某些代码被重新考虑用于未来的更改,您可以继续发送已知的

工作代码,同时保存未来工作的新方法。


我以前做过这种事。我认为ifdef是一种

书签,用于我正在研究的创意。特别是当我不想要b $ b时,我还没有对任何开发路径进行更改,因为我在毛茸茸的眼睛的中间位置。本地开发模式,以便挖出一些

的想法。

Someone wanted to have some compile-time options. The idea is that you
stick in some code that you want to test under specific circumstances,
perhaps for debugging purposes.

It probably isn''t recommended for production code, but if some code is
being rethought for future changes you can continue to ship known
working code, while saving a new approach for future work.

I''ve done this sort of thing before. I consider the ifdef a sort of
bookmark for ideas I''m working on. Especially when I don''t want to
commit my changes to any development path quite yet, because I''m in the
middle of "hairy-eyed" local development mode in order to hash out some
ideas.




code break写道:

code break wrote:

大家好,

请任何人告诉我下面代码的重要性......


#如果0 / *是什么使用这个宏条件。因为

这是每次都是假的。* /
Hi all,
Please can any one tell me the importance of below code...

#if 0 /*what is use of this macro conditional.since
this is every time false .*/



我通常定义一些符号,例如:


#define Dont_Run_This_Code_Until_Hans_Finishes_His_Module 0000000000

I usually define some symbol, something like:

#define Dont_Run_This_Code_Until_Hans_Finishes_His_Module 0000000000


这篇关于宏条件..........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆