Looks like you are missing return statements, this is an improvement
node* Avlnode::Avlsearch(string x,Avlnode* t)
{
if (t==NULL)
{
cout<<"why you search whats not in string";//invalid search
exit(0);
}
else
{
if(isLess(x,t->element)) //isLess compares strings and works good
{ //element refers to the string stored in Avlnode
return Avlsearch(x,t->left);
^^^^^^
}
else if (isLess(t->element,x))
{
return Avlsearch(x,t->right);
^^^^^^
}
else
{
cout<<"found";
cout<<t->index->empname;
return t->index; //its fine till here
}
}
}