Macros


Macros are built on the #define preprocessor.

Normally a #define would look like:

	#define PI 3.142
But, a macro would look like this.
	#define SQUARE(x) x*x
The main difference is that the first example is a constant and the second is an expression. If the macro above was used in some code it may look like this:
        #define SQUARE(x)  x*x

        main()
        {
          int value=3;
          printf("%d \n", SQUARE(value));
        }
After preprocessing the code would become:
        main()
        {
          int value=3;
          printf("%d \n", value*value);
        }

Examples:

macro example.


Notes:


See Also:


Top Master Index Keywords Functions


Martin Leslie

et-next.git/diff/sound/soc/atmel/atmel-pcm-dma.c?h=nds-private-remove&id=2ef0359031b9ed891ca381b2687186fb52b277f8'>diff

path: root/sound/soc/atmel/atmel-pcm-dma.c
AgeCommit message (Expand)AuthorFilesLines