Link sort and fwrite funtion help?

This is a discussion on Link sort and fwrite funtion help? within the C Programming forums, part of the General Programming Boards category; Hi everyone; This is my first message but not least i think =) So i wanna get some information about ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    1

    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
    Location
    New York
    Posts
    1,465
    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.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21