I have a function that is supposed to add a node to a linked list. I'm not sure what the other 2 parts of the for loop are for this. Can anyone help me figure those out? Also, is everything else I have right? Linked lists are pretty new to me so i may have some other mistakes.
Code:
void add_node(info_node **headp, char job_title[25], double wage)
{
info_node *current_node;
if (*headp==NULL)
{
*headp=(info_node *)malloc(sizeof(info_node));
(*headp)->linkp==NULL;
}
else
{
for(????;?????;current_node->linkp==NULL)
{
current_node->linkp=(info_node *)malloc(sizeof(info_node));
current_node->linkp->linkp->job_title=job_title;
current_node->linkp->linkp->hourly_wage=wage;
}
}
}