Results 1 to 2 of 2

Thread: Help?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145

    Help?

    #include <iostream>
    #include <set>
    #include <string>


    using namespace std;

    struct WordData
    {
    string Word;
    int Count;
    };

    bool operator<( WordData const& a, WordData const& b )
    {
    <something missing in here>
    };

    typedef set<WordData> WordSet;

    int main()
    {
    WordSet MySet;
    while (true)
    {
    WordData D;
    cin >> D.Word;
    if (D.Word == "eof") break;
    ...
    };

    for (WordSet::iterator it = MySet.begin(); it != MySet.end(); ++it)
    {
    cout << it->Word << " " << it.Count << endl;
    };

    return 0;
    };

    What code am i missing in the <something missing in here>
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    why don't you call string::compare?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width