Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!claris!apple!lenoil From: lenoil@Apple.COM (Robert Lenoil) Newsgroups: comp.lang.c Subject: External constants (was: Does extern "const" allocate storage?) Message-ID: <7736@apple.Apple.Com> Date: 18 Mar 88 23:51:39 GMT References: <7712@apple.Apple.Com> <3034@haddock.ISC.COM> Reply-To: lenoil@apple.UUCP (Robert Lenoil) Organization: Apple Computer Inc, Cupertino, CA Lines: 16 In article <3034@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: >>Does >> extern const int foo; >>expect to be linking to an external constant, or is it linking to an external >>integer, and semantically prohibiting assignment to that integer? > >What do you mean by "linking to an external constant"? Forgive me for lapsing into 8088 assembler, but it's the easiest way to answer this: public foo ;give foo extern scope foo dw 3 ;foo is an external int foo equ 3 ;foo is an external constant In the first example, the address of foo is made public. In the second, foo is a constant and its value (3) is made public, i.e. foo is an external constant.