🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2970

Memory Usage by C

#2970
From: Richard Armstrong
Date: Thu, 19 Nov 1992 19:05
57 lines
2286 bytes
From news.den.mmc.com!crowded-house!richard Thu Nov 19 12:03:52 MST 1992
Article: 20542 of comp.lang.c
Newsgroups: comp.lang.c
Path: news.den.mmc.com!crowded-house!richard
From: richard@crowded-house.den.mmc.com (Richard Armstrong)
Subject: Re: Where are literals stored?
Message-ID: <1992Nov19.185712.25971@den.mmc.com>
Sender: news@den.mmc.com (News)
Nntp-Posting-Host: crowded-house.den.mmc.com
Organization: Martin Marietta
References: <1992Nov18.233739.2335@den.mmc.com>
Date: Thu, 19 Nov 1992 18:57:12 GMT
Lines: 37

In article <1992Nov18.233739.2335@den.mmc.com> 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";
>}
>

The lack of response on this issue has prompted me to supply more information.

We have an application that is running out of heap and stack space.  We are
trying to figure out if the above declarations store the literal strings in
the same place, and if that is the case, we will not bother changing the way
we declare these strings.  If anyone has any suggestions on moving memory
around so that heap and stack are not compromised, then please let me know.

The current environment is Borland C++ on PC's.  We can also use Microsoft C++
7.0.

Thanks in advance.



-- 
My company never said any of this... I didn't either.
Richard Armstrong, Software Engineer, Martin Marietta
Email->>>> richard@crowded-house.den.mmc.com <<<<-Email 



-- 
My company never said any of this... I didn't either.
Richard Armstrong, Software Engineer, Martin Marietta
Email->>>> richard@crowded-house.den.mmc.com <<<<-Email 
Technical Details
Message-ID: <1992Nov19.190526.26770@den.mmc.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!crowded-house!richard

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!crowded-house!richard
From: richard@crowded-house.den.mmc.com (Richard Armstrong)
Subject: Memory Usage by C
Message-ID: <1992Nov19.190526.26770@den.mmc.com>
Sender: news@den.mmc.com (News)
Nntp-Posting-Host: crowded-house.den.mmc.com
Organization: Martin Marietta
Date: Thu, 19 Nov 1992 19:05:26 GMT
Lines: 58