Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Macro vs. Function
Advantages of a macro over a function?
✍: FYIcenter
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, 7343👍, 0💬
Popular Posts:
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...
What is Concern in AOP? gA concern is a particular goal, concept, or area of interesth There are m...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
How To Retrieve Input Values for Checkboxes Properly? - PHP Script Tips - Processing Web Forms If mu...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...