home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!portal!dfuller
- From: dfuller@portal.hq.videocart.com (Dave Fuller)
- Subject: Re: Where are literals stored?
- Message-ID: <BxyuLn.5Av@portal.hq.videocart.com>
- Organization: VideOcart Inc.
- X-Newsreader: Tin 1.1 PL3
- References: <1992Nov18.233739.2335@den.mmc.com>
- Date: Thu, 19 Nov 1992 13:53:47 GMT
- Lines: 25
-
- 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";
- : }
- :
-
- No. The first 1 will actually take up space in the executable module,
- and the second will be pulled of the stack at run time. Of course, I am
- curious why you would want to know where literals are stored. There may
- be an answer to the bigger question here.
-
- Dave Fuller
- dfuller@portal.hq.videocart.com
-
-