I have been working on a contact list database project.
It is a list of a structures called contacts, where each has string data members to be filled in by the user in a terminal menu system. For example phone number, email, screen name, cell phone, etc...
My list has successfully been constructed and i understand how to iterate through it in a search to look at each data member, but I would prefer the user did not have to type an exact/case sensitive word to bring up the appropriate contact.
Basically what I want to know is, say the user enters Tim and I have a contact with a first name of Timothy, how can I let this user know that this is an appropriate match?
My problem seems to be that string.find() only returns the position, and if the substring being searched for is not found by string.find(), you get a junk memory address anyway. Both ways I'm getting integers, with no way to tell whether the search was successful or not.
Also, I would like to make the searches not case sensitive, but foremost I would like to successfully detect whether the search is part of a larger string or not.
Neither of these implementations are necessary to the project, as most students just left it case sensitive and required an exact search. It's just something I would like to know how to do.
If anyone has an answer to either these questions I would greatly appreciate it.