struct token
{
public:
string tokenName;
vector<int> ptrToRow[256];
int docID;
int cnt;
// Overloading operator
bool operator==(const token &tempToken)
{
return (this->tokenName == tempToken.tokenName);
}
friend ostream& operator<<(ostream& os, token& tk)
{
os << tk.tokenName << endl;
for(int j = 0; j < fileCount; j++)
{
os << "DocId: " << j+1 << endl;
for(vector<int>::iterator it = tk.ptrToRow->begin(); it != tk.ptrToRow->end(); it++)
{
os << " [" << *it << "] ";
}
}
return os;
}
token::token( int fileCount )
{
this->tokenName = "";
this->docID = 0;
this->cnt = 0;
}
token::~token()
{
}
};
friend ostream& operator<<(ostream& os, token& tk)
{
os << tk.tokenName << endl;
for(int j = 0; j < fileCount; j++)
{
os << "DocId: " << j+1 << endl;
for(vector<int>::iterator it = tk.ptrToRow->begin(); it != tk.ptrToRow->end(); it++)
{
os << " [" << *it << "] ";
}
}
return os;
}
so in the inner most for loop how to i tell it to move to the next element in the array? for example i want to do something similiar to this but the compiler is giving me an error
for(int j = 0; j < fileCount; j++)
{
os << "DocId: " << j+1 << endl;
for(vector<int>::iterator it = tk.ptrToRow[fileCount]->begin(); it != tk.ptrToRow[fileCount]->end(); it++)
{
os << " [" << *it << "] ";
}
}