The Cavalier Programmer
The bugs are for you to find! I'm wired in! Are you?
Sunday, 6 May 2012
Updating a node value in Linked List in C
void modify(int oldvalue,int newvalue)
{
node *ptr=start;
while(ptr->info!=oldvalue&&ptr!=NULL)
{
ptr=ptr->link;
}
if(ptr->info==oldvalue)
{
ptr->info=newvalue;
}
else
{
printf("\n\n%d not found in the linked list\n",oldvalue);
getch();
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment