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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!jutta
  3. From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
  4. Subject: Re: const char *p == char const *p ?
  5. Message-ID: <1992Nov16.010820.26757@cs.tu-berlin.de>
  6. Sender: news@cs.tu-berlin.de
  7. Organization: Techn. University of Berlin, Germany
  8. References: <1992Nov15.162912.17454@news.uiowa.edu>
  9. Date: Mon, 16 Nov 1992 01:08:20 GMT
  10. Lines: 18
  11.  
  12. bonak@herky.cs.uiowa.edu (Esmail Bonakdarian) writes:
  13. > Is "char const *p" equivalent to "const char *p"?
  14.  
  15. Yes.  They are both pointers to constant character; you may
  16. change the pointer, but not the character it points to.
  17.  
  18. Some programmers prefer "char const *" to "const char *".
  19. They argue that C declarations are read "inside out":
  20.  
  21.    char const * p ;
  22.                 ^     p is a
  23.               ^              pointer to
  24.         ^^^^^                           constant
  25.    ^^^^                                          char
  26.  
  27. But that's just a matter of style.
  28.  
  29. Jutta
  30.