Thread: Link sort and fwrite funtion help?

  1. #1
    Registered User
    Join Date
    Jan 2006

    Link sort and fwrite funtion help?

    Hi everyone;
    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...

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    New York
    This is called object serialization. This is a nice FAQ on the subject:

    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: 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.

Popular pages Recent additions subscribe to a feed
Website Security Test