All the macros are processed by preprocessor before compilation. Preprocessor starts processing code from top to bottom, so macro definition
should be placed before it's use any where in code file.
Suppose above code is in file example.c
So after preprocessing it will look like below code( cmd used=> gcc -E example.c -o example.i)
int x = SQUARE(2); //Line 3, macro template is not replaced
//macro definition is deleted after preprosessing
In main macro is not replaced with its definition because when preprocessor was processing line 3 it was not aware of macro SQUARE definition which id defined in func() below the main().
So during compilation it generated undefined SQURAE at line 3