home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / EX5.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  637 b   |  23 lines

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