Binary search using word strings?

I'm trying to write a binary search program that finds a word in an alphabetized list/array. I have written a binary search program for numbers so I understand the basic concept, but how do I compare the values of different words? How is "dog" greater than "cat", etc.? How would I determine if a user entered value is greater or less than any given word in the string? Thanks.

std::string has operators < and > overloaded.
if you want to use c-strings, there is strcmp.
"dog" is greater than "cat" because "c" goes before "d".
Topic archived. No new replies allowed.