![]() |
| ||
| please help!! have some problems with my address book i need to write a program that is acting as a simple personal address book with the record of name,email and phone numbers. The range of function should have: searching existing records. adding new records. deleting existing records. i need to include the last update date and time of the record in the form of dd-mm-yyyy,hh:mm:ss(it has to be updated by th program automatically) and i don't really know how. Can't someone help me? I'm new to C language. And there is some problem in the delete function, edit function and the file operation. Below is the code of what my group members and I did so far #include <stdio.h> |
| ||
| Re: please help!! have some problems with my address book >>i need to include the last update date and time of the record in the form of dd-mm-yyyy,hh:mm:ss(it has to be updated by th program automatically) and i don't really know how. Just add another field called UpdateDateTime (or whatever you want to call it) to each record which would be time_t. When you write a record get the system's time using time() function from time.h and save it to the field along with all the other information. If you don't want to save the date/time as an integer then you can call localtime() that returns a string and save that, but it will take up alot more space in the file. |
| ||
| Re: please help!! have some problems with my address book oh..ok..thank you so much!!now i have no problem with the time and date thingy..but still have another question that is on exiting the program all active records must be stored in a file eg. phonebook.txt. On start up, the program should read the stored file and display records on the screen.If the file does't exist, have to create a new one to store information. The program should prompt the user for input to perform the functions listed above. Which function i need to use? and how? |
| ||
| Re: please help!! have some problems with my address book you need to use FILE*. On program startup, attempt to open the file for reading. If successful, then do what you mentioned. If not, then the file doesn't exist. >>Which function i need to use? and how? This is just normal file i/o stuff that should be explained in your textbook. fopen() -- opens the file fread() and fgets() -- reads the file fwrite() -- writes the file fseek() -- move file pointer around the file fclose() -- close the file |
| ||
| Re: please help!! have some problems with my address book now my program can be saved, however when i want to delete a contact, it can't be deleted completely, what's wrong? void delete_from_list (void) |
| All times are GMT -4. The time now is 5:24 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC