Can you extern a #define variable in another file?

c, extern, global

Solution

If you have `#define NAME "supreeth"` in abc.c, you can surely have a extern variable by same name in another file `def.c`, this is as far as the compiler is concerned. If you are implying some kind of dependency between these two, that dependency/linkage will not happen. Obviously it is confusing and a bad idea to do something like this.

Problem

For example abc.c contains a variable ``` #define NAME "supreeth" ``` Can extern the variable `NAME` in def.c?

Original source