home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: Where are literals stored?
- Message-ID: <1992Nov19.191259.23917@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Nov18.233739.2335@den.mmc.com>
- Date: Thu, 19 Nov 1992 19:12:59 GMT
- Lines: 27
-
- richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
-
- |Are literals always stored in the same location in memory? (IBM-PC,Borland)
-
- |For instance, is the string a stored in the same place in the following
- |two declarations?:
-
- |static char a[]="ABC"
- |funca()
- |{
- |}
-
- |funca()
- |{
- |char a[]="ABC";
- |}
-
-
- Nothing in the C language specifies where string literals are stored,
- whether they are always stored in the same address space, or whether
- identical string literals may share storage. You have to read the
- manual for your compiler. Some compilers have directives for
- controlling where literals are stored.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-