7 Years
Discussion Span
Last Post by amrita111

That's like asking what are the advantages of Apples over Video Games. They are two different things.

Votes + Comments
why bother

An external variable has a specific type. Therefore the compiler will do type-checking when compiling. You can also assign a value to a global variable at run-time.

As WaltP said, Macros are very different. When a Macro is referenced, the compiler simply copies the value and pastes it in the code where you've used it (before compiling). It is equivalent to using a Find & Replace tool in a text editor. It does allow for some additional functionality however, such as #ifdef/#ifndef, #undef and functions. Although those are somewhat dependent on the compiler.


Macros and External Variables are really two different things:-
Macros are preprocessor directive means they are executed before the actual compilation of code begins.They are started with #define.

External Variables are used for declaration of variables(local), they can be defined any where in the programs.By default value stored in global is 0 and declared as int type.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.