Thread: C++ Question
View Single Post
  #5  
Old 12-06-2005, 04:38 PM
OrcaDK OrcaDK is offline
Member
 
Join Date: Nov 2004
Posts: 42
Default Re: C++ Question

[ QUOTE ]
You wouldn't know an easy search function would you? I need to be able to let the user seach for a name and output the matching results. I know you can use a bubble sort for numbers, but is there anything similar for searches? I also need a way to verify that the user imputs the phone numbers in the format XXX-XXX-XXXX. I was thinking some type of if then statement, but I'm not real sure how to compare numbers withing an integer like that. ANy help would be appreciated.

[/ QUOTE ]

For the input validation, check up on regular expressions. I have no experience using regexep in C++, so unfortunately i can't help you. Regarding the search, you could actually use regexp for this also, depending on what kind of search you're doing. Should the search return partial results ("es" matching "test" and so on), or should it only return exact matches? If it's exact matches you're going for, sort the list and make a binary search.
Reply With Quote