I have the following code that performs the search in Rear order of a tree:
template<class T>
Lista<NodoArbol<T>>* Arbol<T>::ordenPosterior(NodoArbol<T>*origen,Lista<NodoArbol<T>>* OPos){
while(1){
NodoArbol<T>* siguiente = *origen->getSiguiente();
if(siguiente->getElemento()!=nullptr){
ordenPosterior(siguiente,OPos);
OPos->add(siguiente,OPos);
}else{
break;
}
}
}
I have the function getNext defined this way:
template <class T>
NodoArbol<T> NodoArbol<T>::getSiguiente(){
return this->hijos->getValor(this->hijos,siguiente++);
}
In the NodoArbol children list, I put NodoArbol references to access the children of that node, the problem is presented in the line:
NodoArbol<T>* siguiente = *origen->getSiguiente();
With the following error:
..\src\Arbol.h:78:29: error: no match for 'operator*' (operand type is 'NodoArbol<Vertice>')
I'm new to this in the C ++ objects and I think I have a reference problem but I do not know how to identify which notation I should use if the reference to the class or the pointer to the reference