home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16559 next >
Encoding:
Text File  |  1992-11-15  |  912 b   |  35 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!news.uiowa.edu!herky.cs.uiowa.edu!bonak
  3. From: bonak@herky.cs.uiowa.edu (Esmail Bonakdarian)
  4. Subject: const char *p ==  char const *p ?
  5. Message-ID: <1992Nov15.162912.17454@news.uiowa.edu>
  6. Sender: news@news.uiowa.edu (News)
  7. Date: Sun, 15 Nov 1992 16:29:12 GMT
  8. Reply-To: bonak@herky.cs.uiowa.edu (Esmail Bonakdarian)
  9. Nntp-Posting-Host: herky.cs.uiowa.edu
  10. Organization: U of Iowa, Iowa City, IA
  11. Lines: 22
  12.  
  13. I looked in the faq file but didn't find the answer for this exact question.
  14.  
  15. MY QUESTION IS:
  16.  
  17.   char const *p 
  18.  
  19. equivalent to
  20.  
  21.   const char *p    ?
  22.  
  23.  
  24. I.e, both pointers can be modified, but can not modify the contents at 
  25. the location they are pointing to (correct?)
  26.  
  27. I  understand that
  28.   char *const p 
  29. is a constant pointer, i.e., the pointer can not be modified, but
  30. the contents of the location it is pointing to can.
  31.  
  32. Thanks for clearing up my question
  33.  
  34. Esmail
  35.