dos_compilers/Borland Turbo C++ v1/EXAMPLES/DICTION.H
2024-07-02 07:34:51 -07:00

21 lines
533 B
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// diction.h: The Dictionary class
// from Chapter 6 of User's Guide
#include "def.h"
const int Maxwords = 100;
class Dictionary
{
Definition *words; // An array of definitions; line 9
int nwords;
int find_word(char *); // line 12
public:
// The constructor is on the next line
Dictionary(int n = Maxwords) {nwords = 0; words = new Definition[n];};
~Dictionary() {delete words;}; // This is the destructor
void add_def(char *s, char **def);
int get_def(char *, char **);
};