www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/12/01:40:02

Newsgroups: comp.os.msdos.djgpp
From: design AT netcom DOT com (Chris Waters)
Subject: Re: Labelled array display element funny
Message-ID: <designDz4xJA.H28@netcom.com>
Organization: Design and Delivery
References: <1 DOT 5 DOT 4 DOT 16 DOT 19961011134329 DOT 0a370e00 AT dmeasc DOT rc DOT ipt DOT br>
Date: Fri, 11 Oct 1996 23:35:33 GMT
Lines: 24
Sender: design AT netcom22 DOT netcom DOT com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <1 DOT 5 DOT 4 DOT 16 DOT 19961011134329 DOT 0a370e00 AT dmeasc DOT rc DOT ipt DOT br>,
Cesar Scarpini Rabak  <csrabak AT dce03 DOT ipt DOT br> wrote:
>At 11:09 11/10/96 GMT, Chris Waters wrote:

>>In any case, since this is an initializer for a (presumably) global data
>>element, why don't you put it in a separate file by itself and compile
>>just that file as C.

>Or perharps just wrap the declaration with extern "C" ?

Do you mean "wrap the definition?"  If so, the answer is:  because that
won't work.  If you'd been following the discussion, you'd know that the
feature in question is a non-standard gcc extension only available in C.
Using extern "C" only affects the name used by the linker; it does not
automatically switch you into C.

If you really did mean "declaration," then the answer is, there's no
"just" about it; you must *also* wrap the declaration with extern "C" in
order to access it from C++.  But that discussion is more relevant to
comp.lang.c or comp.lang.c++, and I have been hoping that this fellow
would start to learn something about posting to appropriate groups. :)

cheers,
Chris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019