home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / tcpp / examples / def2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-10  |  513 b   |  20 lines

  1. // def2.h:   Eine Wort-Definitionsklasse
  2. // aus Kapitel 6 der Einführung
  3. #include <string.h>
  4.  
  5. const int Maxmeans = 5;
  6.  
  7. class Definition
  8. {
  9.    char *word;                      // Wort wird definiert
  10.    char *meanings[Maxmeans];        // Verschiedene Bedeutungen des Wortes
  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;         // Zeile 18
  19. };
  20.