Re: confused about extern use



Lalatendu Das wrote:

Here in the above example I am confused about, what extra the coder
going to achieve by declaring it as extern in the header file a.h.

So it can be used in another compilation unit.

--
Ian Collins.
.



Relevant Pages

  • Re: External structs - newbie question
    ... Declaring it in a header file is the right way to go. ... You should declare it extern in the header, ... Below I've given an example layout for your header file. ... int main ...
    (comp.lang.c)
  • Re: confused about extern use
    ... going to achieve by declaring it as extern in the header file a.h. ... Actually what u mean by another compilation unit. ...
    (comp.lang.c)
  • Re: Global Instance
    ... seeing how you are declaring it would be helpful. ... description, it sounds like you are declaring it in the header file, which ... It should be extern in the header and declared in *one* C/C++ file. ... beitman AT applieddata DOT net ...
    (microsoft.public.pocketpc.developer)
  • Re: confused about extern use
    ... going to achieve by declaring it as extern in the header file a.h. ... Actually what u mean by another compilation unit. ...
    (comp.lang.c)
  • Re: static function declaration in header file
    ... >> Is there any reason for declaring functions as static in a header file ... >> called in the source file. ... >> The functions are declared static as an optimization. ... What overhead is saved by declaring the functions static? ...
    (comp.lang.c)