本文整理汇总了C++中Hash::PrintTable方法的典型用法代码示例。如果您正苦于以下问题:C++ Hash::PrintTable方法的具体用法?C++ Hash::PrintTable怎么用?C++ Hash::PrintTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hash
的用法示例。
在下文中一共展示了Hash::PrintTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char * argv[]) {
Hash Hashy;
string name = "";
Hashy.AddItem("wutong", "beer");
Hashy.AddItem("sunsining", "wine");
// Hashy.PrintItemsInIndex(0);
// while(name != "exit"){
// cout << "Search for ";
// cin >> name;
// if(name != "exit"){
// Hashy.FindDrink(name);
// }
// }
Hashy.PrintTable();
while(name != "exit"){
cout << "Remove ";
cin >> name;
if(name != "exit"){
Hashy.RemoveItem(name);
}
}
Hashy.PrintTable();
return 0;
}
示例2: main
int main(int argc, char *argv[]) {
Hash hashy;
hashy.AddItem("192.168.0.1", 1, 1 * 1);
hashy.AddItem("192.168.0.2", 2, 2 * 2);
hashy.AddItem("192.168.0.3", 3, 3 * 4);
hashy.AddItem("192.168.0.4", 4, 4 * 4);
hashy.AddItem("192.168.0.5", 5, 5 * 5);
hashy.AddItem("192.168.0.6", 6, 6 * 6);
hashy.AddItem("192.168.0.7", 7, 7 * 7);
hashy.AddItem("192.168.0.8", 8, 8 * 8);
hashy.AddItem("192.168.0.9", 9, 9 * 9);
hashy.AddItem("192.168.0.10", 10, 10 * 10);
hashy.AddItem("192.168.0.11", 11, 11 * 11);
// cout << hashy.NumberOfItemsInIndex(2) << endl;
hashy.PrintTable();
// hashy.PrintItemsInIndex(2);
cout << "findHopCount" << endl;
functionTest(hashy, 0);
cout << "removeHopCount "<< endl;
functionTest(hashy, 1);
// hashy.Test();
// hashy.PrintItemsInIndex(8);
return 0;
}
示例3: main
int main(int argc, char** argv)
{
Hash Hashy;
string name = "";
Hashy.AddItem("Paul","malibu");
Hashy.AddItem("Annie", "vodka");
Hashy.AddItem("Emma", "rhum");
Hashy.AddItem("Celine", "passoa");
Hashy.AddItem("Robert", "beer");
Hashy.AddItem("Jerem", "water");
Hashy.PrintTable();
/*
Hashy.PrintItemsInIndex(5);
Hashy.PrintItemsInIndex(2);
Hashy.PrintItemsInIndex(4);
*/
while(name != "exit")
{
cout << "Remove for ";
cin >> name;
if(name != "exit")
Hashy.RemoveItem(name);
}
return 0;
}