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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: Where are literals stored?
  5. Message-ID: <BxyuLn.5Av@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <1992Nov18.233739.2335@den.mmc.com>
  9. Date: Thu, 19 Nov 1992 13:53:47 GMT
  10. Lines: 25
  11.  
  12. richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
  13. : Are literals always stored in the same location in memory? (IBM-PC,Borland)
  14. : For instance, is the string a stored in the same place in the following
  15. : two declarations?:
  16. : static char a[]="ABC"
  17. : funca()
  18. : {
  19. : }
  20. : funca()
  21. : {
  22. : char a[]="ABC";
  23. : }
  24.  
  25.    No. The first 1 will actually take up space in the executable module,
  26. and the second will be pulled of the stack at run time. Of course, I am  
  27. curious why you would want to know where literals are stored. There may
  28. be an answer to the bigger question here.
  29.  
  30. Dave Fuller
  31. dfuller@portal.hq.videocart.com
  32.  
  33.