struct link
{
char name[50];
int value;
link* next;
};
class linklist
{
private :
link* first; // ilk baglantiyi tutar
public:
linklist()
{
first=NULL;
}
void additem(int d,char a[]);
void display();
};
void linklist::additem(int d,char a[])
{
link* newlink=new link;
newlink->value=d;
strcpy(newlink->name,a);
newlink->next=first;
first=newlink;
}
this is my link list class and what i want to do after adding some nodes, i want to find and exact node using the name kept in node and change its value.
For example
1st nodes name=abc , value=1
2nd nodes name =xyz, value=5
3rd nodes name =anothername, value=40
and i want to write a function or a simple loop that finds node by its name and change its value.Ill be very happy if anyone will help.