home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13648 < prev    next >
Encoding:
Text File  |  1992-09-14  |  649 b   |  27 lines

  1. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!not-for-mail
  2. From: ren@miles.mps.ohio-state.edu (Liming Ren)
  3. Newsgroups: comp.lang.c++
  4. Subject: A question about "const".
  5. Date: 14 Sep 1992 22:18:53 -0400
  6. Organization: Department of Mathematics, The Ohio State University
  7. Lines: 15
  8. Distribution: usa
  9. Message-ID: <193h6dINN2of@miles.mps.ohio-state.edu>
  10. NNTP-Posting-Host: miles.mps.ohio-state.edu
  11.  
  12.  
  13.  
  14.  Could somebody tell me what the role of const is in the following code?
  15. I am new to C++. 
  16.  
  17.  
  18. class    String{
  19. public:
  20.     int length() const {return len;} //The const in between ) and {
  21.     //...
  22. private:
  23.     int len;
  24.     char *str;
  25.  
  26. }
  27.