/** * add a word to dictionary */ void addWord(Dict &d, const string &key, const string &value){ word w = {key, value}; if (!d.add(w)) cout << "Add failed.\n"; d.printDict(); }
void removeWord(Dict &d, const string &key){ d.remove(key); d.printDict(); }
void updateWord(Dict &d, const word &w){ d.update(w); d.printDict(); }
void searchWord(Dict &d, const string &description, const string &key){ cout << description << d.search(key) << endl; d.printDict(); }