Classe constructor and Vector question
I was wondering how to declare a vector into a constructor. Can someone kindly tell me where I am going wrong?
Code:
class WordRecord
{
public:
WordRecord(vector<string> &vs, LineRecord * & pLineRec);
I am not sure about the declarations here:
Code:
WordRecord::WordRecord(vector<string> &vs, string *p)
{
vectorString[i]= vs[i];
*pLineRec = *p;
}
This is to create a new Word Record, which brings in a Line Record (I am also wondering if I am bringing in the Line Record properly):
Code:
LineRecord * pLineRec;
WordRecord * pWordRec;
vector<string> vs[80];
vs[i].push_back(line);
pLineRec = new LineRecord(sentence, filename, lineNum);
pWordRec = new WordRecord(vs[i], pLineRec);
In any case, I can't seem to be able to bring in the vector into the Word Record. I know it's because I can't declare my constructor properly. Any help would be much appreciated.