home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!borland.com!sjc
- From: sjc@borland.com (Steve Correll)
- Subject: Re: Memory Usage by C
- Message-ID: <1992Nov23.055611.11753@borland.com>
- Originator: sjc@genghis.borland.com
- Sender: news@borland.com (News Admin)
- Organization: Borland International
- References: <1992Nov19.190526.26770@den.mmc.com> <1992Nov20.020950.15516@nntpd.lkg.dec.com>
- Date: Mon, 23 Nov 1992 05:56:11 GMT
- Lines: 23
-
- In article <1992Nov20.020950.15516@nntpd.lkg.dec.com> diamond@jit.dec.com (Norman Diamond) writes:
- >In article <1992Nov19.190526.26770@den.mmc.com> richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
- >>Are literals always stored in the same location in memory?
- >
- >The standard says that identical string literals need not be distinct...
- >
- >>(IBM-PC,Borland)
- >
- >Ask Borland...
- >
- >>For instance, is the string a stored in the same place in the following
- >>two declarations?:
- >>static char *a[]="ABC";
- >>funca()
- >>{
- >>char *a[]="ABC";
- >>}
-
- Ask and ye shall receive: whether the Borland compiler overlays duplicate string
- literals within this compilation depends on the "-d" flag (or, for the IDE, the
- OPTIONS|COMPILER|CODEGENERATION menu). The compiler will complain about the
- absence of {} around the string (perhaps you meant to say "char a[]" or "char
- *a" rather than "char *a[]"?) due to section 3.5.7 of the standard.
-