A: 

If SuffixableElement is your interface, then StemmedSentence must derive from it.

Kerido
+1  A: 
// --- returns n-th sentence of this snippet
SuffixableElement* ArrayStemmedSnippet::getSentence(int n) {
    // ...
    return (SuffixableElement*)sentences[ n ];
}

'sentences' is an array of objects of the StemmedSentence class. StemmedSentence is not derived from SuffixableElement, that is it does not provide that interface.

Try the following:

class StemmedSentence : public ArrayStemmedSnippet, public SuffixableElement {
    // ...
};

and

SuffixableElement* ArrayStemmedSnippet::getSentence(int n) {
    StemmedSentence* sentence = sentences[ n ];
    sentence->setParent(this);
    return sentence;
}
Corwin
Way before when I try to print out a snippet[ <some index> ] array item within the get() Function in StemmedSentence class, the array is NULL, because I instanciated from the interface side. It is simply not visible from SuffixableElement Interface. All the entered data done by ArrayStemmedSnippet ass( stemmed ); is not visible. I think I have some basic misunderstanduing here, I just do not get it ....
Andreas W. Wylach
Scroll down the first code window of my main post (class definition) It is there as the last entry ....
Andreas W. Wylach
Well, which classes do implement this interface?
Corwin
That is the StemmedSentence Class, see "virtual void * get(int index)" and the "". get returns a single StemmedTerm object out of the StemmedSentence Object, size returns the size of the StemmedSentence object.I'll try your suggestion now ...
Andreas W. Wylach
I just wonder if setParent() is not the same as calling StemmedSentence(this) constructor? This seems not not work so does not setParent(this) by setting the StemmedSentence *parent variable. How did you implement setParent() in in StemmedSentence class?
Andreas W. Wylach
My bad .. it works!! Seems like the way setting the ArrayStemmedSnippet Object in getSentence did it. Thanks Corwin! I can continue the development :-)
Andreas W. Wylach