示例#1
0
文件: lab1.cpp 项目: DreamDg/Lab1
/**
 * 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();
}
示例#2
0
文件: lab1.cpp 项目: DreamDg/Lab1
void removeWord(Dict &d, const string &key){
	d.remove(key);
	d.printDict();
}
示例#3
0
文件: lab1.cpp 项目: DreamDg/Lab1
void updateWord(Dict &d, const word &w){
	d.update(w);
	d.printDict();
}
示例#4
0
文件: lab1.cpp 项目: DreamDg/Lab1
void searchWord(Dict &d, const string &description, const string &key){
	cout << description  <<  d.search(key) << endl;
	d.printDict();
}