hi this is the class, implementation and main of my solution... and the error.. can some one please check it for me and let me know what is the problem? thank you..
this is the class code
this is the implementation codeCode:#include <string> #include <iostream> #include <vector> #include "stringset.h" using namespace std; class InvertedIndex { //insert data member here vector <StringSet> list; public: // Tally adds one word/file pair to the index void tally(string word, string file);
and this is main codeCode:#include "inverted_index.h" #include "osdir.h" int InvertedIndex::size() { return list.size(); } // InvertedIndex::tally // Pre: a word and file pair as strings // Post: adds the file to the index under word void InvertedIndex::tally(string word, string file) { list.push_back(word); }
i just want to insert those data into list.....Code:#include "inverted_index.h" int main() { StringSet ss; ss.insert("one"); ss.insert("two"); ss.insert("three"); ss.insert("one"); ss.print(); if ( ss.contains("one") ) cout << "ok - contains('one')\n"; else cout << "fail - contains('one')\n"; // test the InvertedIndex InvertedIndex idx; idx.tally("nissan", "car.txt"); idx.tally("nissa", "carbrand.txt"); idx.tally("nissan", "everything.txt"); idx.tally("honda", "hondacar.txt");



LinkBack URL
About LinkBacks



ush_back(std::string&)' 