Software QA (13)
SQL Server (1)
Macro vs. Function
Advantages of a macro over a function?
Macro gets to see the Compilation environment, so it can expand __DATE__ __TIME__ __FILE__ #defines. It is expanded by the preprocessor.
For example, you can't do this without macros.
#define PRINT(EXPR) printf( #EXPR "=%d\n", EXPR) PRINT( 5+6*7 ) // expands into printf("5+6*7=%d", 5+6*7);
You can define your mini language with macros:
#define strequal(A,B) (!strcmp(A,B))
Macros are a necessary evils of life. The purists don't like them, but without it no real work gets done.
2007-02-26, 7028👍, 0💬
.NET INTERVIEW QUESTIONS - What is the difference between System exceptions and Application exceptio...
How can we connect to Microsoft Access , Foxpro , Oracle etc ? Microsoft provides System.Data.OleDb ...
What is a delegate ? Delegate is a class that can hold a reference to a method or a function. Delega...
How Many Tags Are Defined in HTML 4.01? There are 77 tags defined in HTML 4.01: a abbr acronym addre...
How do I install JUnit? First I will download the lastest version of JUnit. Then I will extract all ...