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

  1. // def.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);};  // line 15
  16.    void add_meaning(char *);
  17.    char *get_meaning(int, char *);
  18. };
  19.