summaryrefslogtreecommitdiff
path: root/components/rtgui/utils/perfect_hash/example-C++/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'components/rtgui/utils/perfect_hash/example-C++/main.cc')
-rw-r--r--components/rtgui/utils/perfect_hash/example-C++/main.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/components/rtgui/utils/perfect_hash/example-C++/main.cc b/components/rtgui/utils/perfect_hash/example-C++/main.cc
new file mode 100644
index 0000000000..9d724a7872
--- /dev/null
+++ b/components/rtgui/utils/perfect_hash/example-C++/main.cc
@@ -0,0 +1,24 @@
+
+#include <iostream>
+#include <string>
+using namespace std;
+
+#include "states-code.hh"
+
+
+int main (int argc, char *argv[])
+{
+ if (argc != 2) {
+ printf ("Usage: %s <abbreviation>\n", argv[0]);
+ return 2;
+ }
+
+ string abbr = argv[1];
+
+ State s(abbr);
+
+ cout << "The state of " << s.name ()
+ << " has a population of " << 1e-6 * s.population () << " million.\n";
+
+ return 0;
+}