struct Keyword
{
std::string keyword;
int numUses;
};
bool sortingVector(const Keyword& key1, const Keyword& key2)
{
return key1.numUses < key2
#include
#include
#include
struct Keyword
{
std::string keyword;
int numUses;
};
bool sortingVector(const Keyword& key1, const Keyword& key2)
{
return key1.numUses < key2.numUses;
}
int main()
{
std::vector topKeywords(100);
// imagine topKeywords initialization here
std::sort(topKeywords.begin(), topKeywords.end(), sortingVector);
return 0;
}
Compiles fine on my machine (gcc version 4.4.3).