One problem is your misuse of the name variable. In your code posted, it is an array of 33 string objects but when you read it in from the user you say getline(cin,name); which is wrong. Look closely at Hammer's 2nd post, the name variable has been made a single string and not an array of them. With the use of the name variable as an array, the call to your search function shouldn't work because your function definition takes a single string as the third argument but you are passing it an array.
You can also double check your sorting routine by outputing the entire array after it has been sorted to make sure the sort has happened correctly. If this isn't working properly, then it should be quite obvious that the search function may or may not work.