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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: Where are literals stored?
  5. Message-ID: <1992Nov19.191259.23917@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <1992Nov18.233739.2335@den.mmc.com>
  8. Date: Thu, 19 Nov 1992 19:12:59 GMT
  9. Lines: 27
  10.  
  11. richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
  12.  
  13. |Are literals always stored in the same location in memory? (IBM-PC,Borland)
  14.  
  15. |For instance, is the string a stored in the same place in the following
  16. |two declarations?:
  17.  
  18. |static char a[]="ABC"
  19. |funca()
  20. |{
  21. |}
  22.  
  23. |funca()
  24. |{
  25. |char a[]="ABC";
  26. |}
  27.  
  28.  
  29. Nothing in the C language specifies where string literals are stored,
  30. whether they are always stored in the same address space, or whether
  31. identical string literals may share storage.  You have to read the
  32. manual for your compiler.  Some compilers have directives for
  33. controlling where literals are stored.
  34. -- 
  35.  
  36. Steve Clamage, TauMetric Corp, steve@taumet.com
  37. Vice Chair, ANSI C++ Committee, X3J16
  38.