[cvs] / jsr166 / src / test / CppDemo.cpp Repository:
ViewVC logotype

View of /jsr166/src/test/CppDemo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Tue Sep 18 12:55:32 2007 UTC (5 years, 8 months ago) by jsr166
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Unused demo programs.
#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