the linked list is a generic linked list List<T> and i want to return a node of type T.
this is what I tried.
list<T> *search(People *x) // I tried search(T *s) too
{
list<T> *q = root_list;
while(q)
{
if(q!=NULL && strcmp(q->element,x->name)==0)
return q;
else
q = q->next;
}
return NULL;
};
People is a class which has name as a private.I get this error. Cannot convert People* to const char*, and after trying different syntax sometimes i get People::name member is not accesible

New Topic/Question
Reply




MultiQuote






|