home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / tcpp / examples / diction.h < prev    next >
C/C++ Source or Header  |  1990-06-09  |  501b  |  27 lines

  1. // diction.h:   Die Wortklasse aus
  2. // Kapitel 6 der Einführung
  3.  
  4. #include "def.h"
  5.  
  6. const int Maxwords = 100;
  7.  
  8. class Dictionary
  9. {
  10.    // Ein Array mit Definitionen
  11.    Definition *words;       
  12.    int nwords;
  13.  
  14.    int find_word(char *);
  15.  
  16. public:
  17.    // Der Konstruktor
  18.    Dictionary(int n = Maxwords)
  19.       {nwords = 0; words = new Definition[n];};
  20.  
  21.    // Der Destruktor
  22.    ~Dictionary() {delete words;};
  23.  
  24.    void add_def(char *s, char **def); 
  25.    int get_def(char *, char **);
  26. };
  27.