cognacc wrote:
> On Aug 5, 2:33 pm, cognacc <michael.cogn...@gmail.com> wrote:
>> On Aug 5, 1:42 pm, James Kanze <james.ka...@gmail.com> wrote:
>
>>> Yes, but multiple definitions are undefined behavior. A
>>> compiler is free to accept them. Traditionally, C compilers do,
>>> and C++ compilers don't; a quick experiment here showed that
>>> when compiling C, gcc, Sun cc/CC and VC++ all accept the
>>> multiple definitions without a complaint; if I compile as C++,
>>> only Sun CC accepts them.
>
>> but in C if you define in global scope extern is implicit, as i
>> understand K&R.
>> therefore my
>> int globavar; in global header.
>> is the same as extern int globavar; if i understandd this correctly.
>> ?
> certainly my compiler seems to disagree -
> Does it depends on how i include it?
What exactly do you mean by "how"? Double-quotes versus angle brackets?
I don't think it should matter.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask