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 Answers
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.