Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Monday, March 9, 2015

What is #define ?

The #define is a preprocessor directive which is used to defines value to a symbolic constant for use in the program. It is not a statement and it is not terminated with a semicolon.
It is mainly placed at the beginning of the program before the main() function.  It is also called macro. When we compile the program, before the source code passes to the compiler it is examined by the C preprocessor for any macro definitions. When it sees the #define directive, it goes through the entire program in search of the macro templates; wherever it finds one, it replaces the macro template with the appropriate macro expansion. Only after this procedure has been completed is the program handed over to the compiler
Syntax:
            #define MACRO_NAME  Value
Ex:

     #define PI 3.14

No comments:

Post a Comment