Parent Directory
|
Revision Log
Add C++/JNI demo targets as first step to possible use of JNI in 1.4-usable version of j.u.c. Still probably highly Windows-specific, but at least it uses gcc, so there is hope.
#include <iostream>
#include <map>
using namespace std;
int main (int argc, const char* const* argv) {
map<string, int> m;
for (int i = 1; i < argc; ++i) {
string word(argv[i]);
++m[word];
}
// map is really a sorted map, so this prints words in
// lexicographic order.
for (map<string, int>::const_iterator it = m.begin(); it != m.end(); ++it) {
cout << it->second << " " << it->first << "\n";
}
}
| Doug Lea | ViewVC Help |
| Powered by ViewVC 1.0.8 |