Using "update" and "remove" (functions) to add and delete records of shop
Information to be maintained is a) Name of the Shop
b) Address
c) Type of work
d) Telephone no.
e) E-mail
Please NOTE: C Code is updated
Hi,
here are three files
a) main file: http://pastebin.com/f11c0d720
Version 2: http://pastebin.com/f78832954
Version 3: http://pastebin.com/f1ace0b37
b) include file dirinfo.h: http://pastebin.com/f67299584
Version 2: http://pastebin.com/f13f2326c
Version 3: http://pastebin.com/f2033f680
c) dirinfo.cpp: http://pastebin.com/f7334da4d
Version 2: http://pastebin.com/f59a2f0c2
Version 3: http://pastebin.com/f1b792cb6
Though the file extension suggests cpp, i hope it will compile as a c program
The idea was the following:
write code,
- which would read a file into a linked list,
- which would be able to append a new entry to a linked list
- which would be able to update existing information
- which would be able to delete existing information
- which would always write the most recent changes into the file
Work needs to be done in
-add_new function: 2 strings are scanned in using scanf. this is not sufficient for most street addresses, telephone numbers, etc. please check. This can be resolved by replacing the function taking 2 arguments by a function taking
1 argument.
-UpdateMenu is implemented and tested.
-delete_Delete is working from within update menu
-delete_list is working
-the code was compiled with a c++ compiler. there might be minor conflicts with a c-compiler
delete_node, update_node add_new are implemented so that all changes are dumped to the file (the whole list) and then re-read into the list again). This definitely can be optimized. Have fun.
All the best.