home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / examples.pak / DEF2.H < prev    next >
Text File  |  1997-07-23  |  566b  |  23 lines

  1. // Borland C++ - (C) Copyright 1991, 1992 by Borland International
  2.  
  3. // def2.h:   A word definition class
  4. // from Getting Started
  5. #include <string.h>
  6.  
  7. const int Maxmeans = 5;
  8.  
  9. class Definition
  10. {
  11.    char *word;                      // Word being defined
  12.    char *meanings[Maxmeans];        // Various meanings of this word
  13.    int nmeanings;
  14.  
  15. public:
  16.    void put_word(char *);
  17.    char *get_word(char *s) {return strcpy(s,word);};
  18.    void add_meaning(char *);
  19.    char *get_meaning(int, char *);
  20.    friend class Dictionary;         // line 18
  21. };
  22. 
  23.