tags:

views:

93

answers:

1

I have a program where i am trying to print a key word string from a set

Sorry i got it figured out..

+2  A: 

you can define your function

string Item::printKeywords(const StringSet* keywords) const
{
return NULL;
}

like this (can be static or outside class)

  string printKeywords(const StringSet& keywords) 
  {
    stringstream ss;
    StringSet::const_iterator it = keywords.begin();
    while (it != keywords.end())
    {
       ss << *it;  // here format it as you want
       ++it;
    }
    return ss.str();
  }
Anders K.