home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / EX5.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  699b  |  26 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. // ex5.cpp:   Using the Definition class
  4. // from Hands-on C++
  5. #include <iostream.h>
  6. #include "def.h"
  7.  
  8. main()
  9. {
  10.    Definition d;          // Declare a Definition object
  11.    char s[81];
  12.  
  13.    // Assign the meanings
  14.    d.put_word("class");
  15.    d.add_meaning("a body of students meeting together to \
  16. study the same subject");
  17.    d.add_meaning("a group sharing the same economic status");
  18.    d.add_meaning("a group, set or kind sharing the same attributes");
  19.  
  20.    // Print them
  21.    cout << d.get_word(s) << ":\n\n";
  22.    for (int i = 0; d.get_meaning(i,s) != 0; ++i)
  23.       cout << (i+1) << ": " << s << "\n";
  24.    return 0;
  25. }
  26.