0
In c#, how to implement functions like c++ macro define?
Macro define very funny and flexible in c++,it makes code very very concise and simple. But in c#,there are only macro declarations,unable to use macro flexible like c++. Maybe attribute in c# can do something like macro in c++,but I don't be familiar with it. From c++ to c#,can't use macro,I feel like lost something...... so......how to use something in c# like macro in c++?
2 ответов
0
c# does not have macros like in c++ because it is a much higher level language, and thus is father from the hardware of the device. the closest thing to preprocessor macros in c# are snippets
+ 1
@hinanawi
very thanks,very useful,snippet is a new word for me.
after some basic stuff,i thought snippet maybe not flexible like macro.