Re: extern question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Trevis,

> should I even be allowed to declare "larry" in both foo.c and
> bar.c ?  If so, why is that not seen as a problem?

You can declare larry as many times as you want.  You've declared it in
main.c and in bar.c.

You can only define larry once.  You've defined it in bar.c.

If you change the declaration of larry in bar.c to a definition, then you've
defined it too many times (i.e., more than once).

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux