how to declare a define external to another module

If you have a define in one file/module and want to use the same define in another file/module without duplicating the define, how do you indicate it is an external define?


  • In one file write

    extern int i;
    and in another file just write int i.

    after seeing extern keyword by compiler, compiler will come to know that this variable is used or declared somewhere else in this module.

    I hope this helps..

    R. R. Nayak
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion