i have problem with my code to search node in link list. can anybody help me? sorry for my english..
node *temp1; // create a temporary node
temp1 = (node*)malloc(sizeof(node)); // allocate space for node
temp1 = head; // transfer the address of 'head' to 'temp1'
bool find = false;
cout<<"ENTER THE VALUE:";
cin>>info; // take value
while (temp1!= NULL)
{
if (temp1->data == info)
{
cout<<"The value entered found at position : "<<counter<<endl;
return main();
}
else
{
temp1= temp1->next; // points to the next node
}
}