how to declare a define external to another module - Programmers Heaven

Howdy, Stranger!

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

Categories

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?

Comments

  • rasmiranjanbabrasmiranjanbab Posts: 1Member
    In one file write
    e.g

    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..

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