I made a project on telephone directory.
I have used single class and my reading and writing in the file is done by
fin.[write/read]((char*)&object,sizeof(object));
Now the problem is during searching a particular name or phone no. is just read the file and match the name or the phone no. in each record.

Now is there any method or way i which my searching speed is increased and it can handle large datas.

Plzz help me

Yes, that's about the size and shape of it.

If you want it quicker, store it in memory.
If you want it quicker, sort it and use a binary search.

Sir but when write in the file at time the data is stored in the memory.
And for sorting them i tried out storing the first character of the name of the user details.
First i compare the first letter and then i compare the string this would increase the speed of the search and can it be used for heavy data search?????

plzz help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.