在preprocessor C#宏定义 [英] C# Macro definitions in Preprocessor
本文介绍了在preprocessor C#宏定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是C#作为能够在与pre-处理器陈述C编程语言做了定义宏?我想简化某些重复的语句,如以下的普通打字:
Console.WriteLine(富);
解决方案
没有,C#不支持,另一方面preprocessor宏像C. Visual Studio中具有的片段的。 Visual Studio的片段是IDE的功能,并在而不是由preprocessor取代了code编译上编辑被扩展。
Is C# able to define macros as is done in the C programming language with pre-processor statements? I would like to simplify regular typing of certain repeating statements such as the following:
Console.WriteLine("foo");
解决方案
No, C# does not support preprocessor macros like C. Visual Studio on the other hand has snippets. Visual Studio's snippets are a feature of the IDE and are expanded in the editor rather than replaced in the code on compilation by a preprocessor.
这篇关于在preprocessor C#宏定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文