i have to make a program which has a structure name book . it includes name of book author and other details of the book.i have to make a menu driven program which has options to : Add a book delete a book sort books etc I know how to proceed but i cant imagine how would i make a function to add a book.plx give me a flow of the prog
A:
You need a container to hold the books. You haven't specified the container. In the C language, you may have to construct (implement) the containers yourself or use a library. For example, are you using a linked list, array, b-tree, stack, queue or file?
Also, you need to know how to insert a book into the container. Is it inserted in the front? Appended to the end? Inserted in the middle?
Do you need to keep the container sorted?
These and many other questions need to be discussed with your teacher or professor. Ask for the algorithm or process. If there are not enough details, ask a colleague or friend. Otherwise drop the course and sign up with another (different) teacher or professor.
Thomas Matthews
2010-07-08 16:18:09