Link sort and fwrite funtion help?
This is my first message but not least i think =)
So i wanna get some information about how to use fwrite functions with structure in node which is entered by user...
i have a structure type char name and char surname and i wanna print this entries a file which can opened by user and get name by user....
My second problem is deleting or adding any nodes between one node to another...How can i do that?
Please help me....
Thank you for your patience....
Have a nice day...
This is called object serialization. This is a nice FAQ on the subject: http://www.parashift.com/c++-faq-lit...alization.html
It is in C++, however just remember your fwrite(..) is equivilant to the write(..) described in the article, and that the '<<' is similar to your fprintf. To delete a node, you would link the previous and next node's in the list, and then free memory associated with the garbage node.
Linked list basics from Stanford: http://cslibrary.stanford.edu/103/ To add a node, you would link the previous one to the new one, and then connect the new one to the one following the previous.