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

/maxim,max77802.h?id=3b1137fe74829e021f483756a648cbb87c8a1b4a'>diff

path: root/include/dt-bindings/clock/maxim,max77802.h
s
AgeCommit message (Expand)AuthorFilesLines