[problem]pointers and recursive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
int arvore::AddValor(node **t, string chave)
{
int saida;
if(!(&(*t)))
{
arvore();
(*t)->esq = NULL;
(*t)->dir = NULL;
(*t)->valor = chave;
return saida;
}
else
{
if((*t)->valor.compare(chave)==0)
{
}
else
{
if((*t)->valor.compare(chave)>0)
{
saida = AddValor( (*t)->esq, string chave);
return saida;
}
else
{
}
}
}
}
|
this function is not correct in a call recursive.("saida = AddValor((*t)->esq, string chave);")
somebody know about this?
grateful now!
Last edited on
I resolved the problem
is not:
saida = AddValor( (*t)->esq, string chave);
the correct is:
|
saida = AddValor( (*t)->esq, chave);
|
THX
xD
Last edited on
Topic archived. No new replies allowed.