I'm trying to make an address book but I have come across a simple problem. All the data (eg. name address etc) is saved into a text file but when I come to relocate it in the txt file how would I do this
I'm trying to make an address book but I have come across a simple problem. All the data (eg. name address etc) is saved into a text file but when I come to relocate it in the txt file how would I do this
1. Google is your friend.
2. Search feature.
3. RTFM.
The world is waiting. I must leave you now.
>>>but when I come to relocate it in the txt file how would I do this
What exactly do you mean? A simple address book will store it's data in memory in some sort of list, then write the list to disk when a save is needed. From there, it can be read back in again.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Here is an example of what i want to do:
The user wants to add a new contact to his address book. So he first enter the contacts name which will be saved to a text file then enter the contacts address and that gets added to the txt file, and so on and so forth until he finshed entering all the data needed. Once he has done this and whats to view the contacts infomation he will look up the contact and then the computer will read the infomation out of the text file and print it onto the screen.
I hope this helps please tell me if it doesn't
OK, so you have a good idea of what you want your application to do. Next start breaking it down into sections and go from there.
Think about how you're going to store the data in memory (list/tree/array etc), how you're going to get the data from the user, any validation needed etc
Once you have it broken down into sections, trying coding some snippets to get you started.
There is plenty of source code on these boards for doing this type of thing, including a competition entry I wrote a while back. Best of using your own code though
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]