home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / DEF2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  506 b   |  20 lines

  1. // def2.h:   A word definition class
  2. // from Chapter 6 of Getting Started
  3. #include <string.h>
  4.  
  5. const int Maxmeans = 5;
  6.  
  7. class Definition
  8. {
  9.    char *word;                      // Word being defined
  10.    char *meanings[Maxmeans];        // Various meanings of this word
  11.    int nmeanings;
  12.  
  13. public:
  14.    void put_word(char *);
  15.    char *get_word(char *s) {return strcpy(s,word);};
  16.    void add_meaning(char *);
  17.    char *get_meaning(int, char *);
  18.    friend class Dictionary;         // line 18
  19. };
  20.