Exemple #1
0
/**
 * 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();
}
Exemple #2
0
void removeWord(Dict &d, const string &key){
	d.remove(key);
	d.printDict();
}
Exemple #3
0
void updateWord(Dict &d, const word &w){
	d.update(w);
	d.printDict();
}
Exemple #4
0
void searchWord(Dict &d, const string &description, const string &key){
	cout << description  <<  d.search(key) << endl;
	d.printDict();
}