#include <iostream>
#include <string>
int main()
{
std::string a ;
std::string b ;
std::cout << "Enter a string: " ;
std::getline(std::cin, a) ;
std::cout << "Enter another string: ";
std::getline(std::cin, b) ;
if ( a == b )
std::cout << "You entered the same string twice.\n" ;
elseif ( a < b )
std::cout << '"' << a << "\" comes before \"" << b << "\"\n" ;
else
std::cout << '"' << b << "\" comes before \"" << a << "\"\n" ;
}
You should not use strcmp() with std::strings; just use the == operator to compare them. If city is a std::string member of your class or something, that looks like a legitimate definition to me.