S
sakitah
Here is what I have:
struct SubList
{
int BookId;
int WFreq;
};
struct Listing
{
string Word;
int BookCnt;
int TWFreq; //total frequency in all books
SubList * ptr[10];
};
A Listing structure will be used as an array like so:
Listing a[100];
Now, the Listing pointer variable s points to an array of SubList
structure, so 1 Listing can point to more than one SubList. If a word
is found in more than one book, it will have one entry in Listing which
then points to SubList with all the book id's it is found in. Either
way, if a word is found in Listing then it is bound to have a book id
and so it's s pointer will have to point to SubList with at least one
entry.
I am a bit confused as to how I'll be accessing this SubList
structure. So far, this is what I have been able to come up with, but
needless to say, it's wrong:
a.Word = FullBase[FBI].Word;
a.BookCnt = 1;
a.TWFreq = FullBase[FBI].WordFreq;
//now make entry for this word into SubList
a.ptr = new Posting;
a.(ptr[0]->BookId) = BookId_tmp;
In the last line, I get an error that the '(' is illegal (followed by a
gazillion other errors, but I'm sure that it is the parenthesis
notation that is wrong).
Gratefull for any help
SA
struct SubList
{
int BookId;
int WFreq;
};
struct Listing
{
string Word;
int BookCnt;
int TWFreq; //total frequency in all books
SubList * ptr[10];
};
A Listing structure will be used as an array like so:
Listing a[100];
Now, the Listing pointer variable s points to an array of SubList
structure, so 1 Listing can point to more than one SubList. If a word
is found in more than one book, it will have one entry in Listing which
then points to SubList with all the book id's it is found in. Either
way, if a word is found in Listing then it is bound to have a book id
and so it's s pointer will have to point to SubList with at least one
entry.
I am a bit confused as to how I'll be accessing this SubList
structure. So far, this is what I have been able to come up with, but
needless to say, it's wrong:
a.Word = FullBase[FBI].Word;
a.BookCnt = 1;
a.TWFreq = FullBase[FBI].WordFreq;
//now make entry for this word into SubList
a.ptr = new Posting;
a.(ptr[0]->BookId) = BookId_tmp;
In the last line, I get an error that the '(' is illegal (followed by a
gazillion other errors, but I'm sure that it is the parenthesis
notation that is wrong).
Gratefull for any help
SA