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

  1. // diction.h:   The Dictionary class
  2. // from Chapter 6 of Getting Started
  3. #include "def.h"
  4.  
  5. const int Maxwords = 100;
  6.  
  7. class Dictionary
  8. {
  9.    Definition *words;       // An array of definitions; line 9
  10.    int nwords;
  11.  
  12.    int find_word(char *);   // line 12
  13.  
  14. public:
  15.    // The constructor is on the next line
  16.    Dictionary(int n = Maxwords)  {nwords = 0; words = new Definition[n];};
  17.    ~Dictionary() {delete words;};    // This is the destructor
  18.    void add_def(char *s, char **def); 
  19.     int get_def(char *, char **);
  20. };
  21.