A
al
To compare two strings, not just to see if they are "equal" ("abcd"="abcd")
but tell their alphabetical order:
string a, b;
a = "abcd";
b = "bbcd";
Can all the ways below to do such comparison?
1. a > b
2. a.compare(b))
3. strcmp(a, b)
4. max(a, b)
Which one you prefer and why?
Thanks!
but tell their alphabetical order:
string a, b;
a = "abcd";
b = "bbcd";
Can all the ways below to do such comparison?
1. a > b
2. a.compare(b))
3. strcmp(a, b)
4. max(a, b)
Which one you prefer and why?
Thanks!