Thread: C++ Question
View Single Post
  #6  
Old 12-06-2005, 04:44 PM
mscags mscags is offline
Senior Member
 
Join Date: Mar 2005
Location: Between Two Hot Twins
Posts: 713
Default Re: C++ Question

[ QUOTE ]
[ 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.

[/ QUOTE ]

Thanks, I think that should get me started.
Reply With Quote