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

  1. // def.h:   Eine Wort-Definitionsklasse aus
  2. // Kapitel 6 der Einführung
  3.  
  4. #include <string.h>
  5.  
  6. const int Maxmeans = 5;
  7.  
  8. class Definition
  9. {
  10.    // Definition des Worts
  11.    char *word;
  12.  
  13.    // Verschiedene Bedeutungen des Wortes
  14.    char *meanings[Maxmeans];      
  15.    int nmeanings;
  16.  
  17. public:
  18.    void put_word(char *);
  19.    char *get_word(char *s)
  20.    { return strcpy(s,word);
  21.    }; 
  22.    void add_meaning(char *);
  23.    char *get_meaning(int, char *);
  24. };
  25.