I need my program to use a linked list but have the options to
1) add record
2)delete record
3)display all records
4)save and exit the program
the linked list needs to be sorted.
What i have so far:
node* Insert(node*pList)
{
node*pNew;
node* pCur;
node* pPre;
pNew=(struct node*)malloc(size of(struct node));
printf(Enter in new node");
fflush(stdin);
fgets(pNew>name,50,stdin);
printf(Please enter in name");
scanf("&ld", &new>Marks);
pNew>linkptr=Null
if(pList= = Null)
{
pList=pNew;
}else
{
search(pList,&pPre, &pCur, p'new>marks);
if(pPre==Null&&pCurr==pList)
{
pNew>link=Plist;
pList=pNew;}
else{
pNew>linkptr=pCur;
pPre>linkptr=pNew;
}
}
return pList;
}
I am not sure this is right. I am a beginner and still working on this.
If anyone can help or give advice please do so. Thanks