lib/structure/test-kdict.cpp
Go to the documentation of this file.00001
00002
#include <iostream>
00003
using std::cout;
00004
using std::endl;
00005
00006
#include "kdict.h"
00007
00008 int main()
00009 {
00010
00011
int v1 = 7;
00012
int v2 = 5;
00013
int v3 = 11;
00014
00015
KDict<int> A;
00016
00017 cout <<
"A empty" << A <<
endl;
00018
00019 A.
insert(
"abd", &v1);
00020 cout <<
"inserted abd 7 " << A <<
endl;
00021
00022 A.
insert(
"abc", &v2);
00023 cout <<
"inserted abc 5 " << A <<
endl;
00024
00025 A.
insert(
"bcg", &v3);
00026 cout <<
"inserted bcg 11 " << A <<
endl;
00027
00028 A.
insert(
"bug", &v1);
00029 cout <<
"inserted bug 7 " << A <<
endl;
00030
00031
unsigned int s = A.
count();
00032 cout <<
"A has " << s <<
" elements" <<
endl;
00033
00034 cout <<
"query abd ";
00035
int* comp = A.
find(
"abd");
00036 cout <<
"found this: " << comp <<
endl;
00037
if (comp) cout <<
"val " << *comp <<
endl;
00038
else cout <<
"not found" <<
endl;
00039
00040
return 0;
00041
00042 }
This file is part of the documentation for KDevelop Version 3.0.4.