hi, i got an erro of this code, can someone please let me know the problem as the error said " undeclare invertedindex"
Code:
#include "inverted_index.h"
#include "osdir.h"
// 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);
list.push_back(file);
}
..........
this is the main
Code:
#include <iostream>
#include <cstdlib>
#include "StringSet.h"
#include <vector>
int main()
{
// test the InvertedIndex
InvertedIndex idx; //the error is here..
idx.tally("hello", "hello.txt");
idx.tally("hi", "hi.txt");
idx.tally("no", "no.txt");
idx.tally("lol", "lol.txt");
system("PAUSE");
return 0;
}