home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16819 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.5 KB  |  50 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!crowded-house!richard
  3. From: richard@crowded-house.den.mmc.com (Richard Armstrong)
  4. Subject: Re: Where are literals stored?
  5. Message-ID: <1992Nov19.185712.25971@den.mmc.com>
  6. Sender: news@den.mmc.com (News)
  7. Nntp-Posting-Host: crowded-house.den.mmc.com
  8. Organization: Martin Marietta
  9. References: <1992Nov18.233739.2335@den.mmc.com>
  10. Date: Thu, 19 Nov 1992 18:57:12 GMT
  11. Lines: 37
  12.  
  13. In article <1992Nov18.233739.2335@den.mmc.com> richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
  14. >Are literals always stored in the same location in memory? (IBM-PC,Borland)
  15. >
  16. >For instance, is the string a stored in the same place in the following
  17. >two declarations?:
  18. >
  19. >static char *a[]="ABC"
  20. >funca()
  21. >{
  22. >}
  23. >
  24. >funca()
  25. >{
  26. >char *a[]="ABC";
  27. >}
  28. >
  29.  
  30. The lack of response on this issue has prompted me to supply more information.
  31.  
  32. We have an application that is running out of heap and stack space.  We are
  33. trying to figure out if the above declarations store the literal strings in
  34. the same place, and if that is the case, we will not bother changing the way
  35. we declare these strings.  If anyone has any suggestions on moving memory
  36. around so that heap and stack are not compromised, then please let me know.
  37.  
  38. The current environment is Borland C++ on PC's.  We can also use Microsoft C++
  39. 7.0.
  40.  
  41. Thanks in advance.
  42.  
  43.  
  44.  
  45. -- 
  46. My company never said any of this... I didn't either.
  47. Richard Armstrong, Software Engineer, Martin Marietta
  48. Email->>>> richard@crowded-house.den.mmc.com <<<<-Email 
  49.  
  50.