When normally comparing the string this way:
#include <iostream>
using namespace std;
int main()
{
string a = "yb";
string b = "ya";
cout<<(a>b);
return 0;
}
result comes out 1
. Which is right.
But when performing the same operation in this way:
#include <iostream>
using namespace std;
int main()
{
cout<<("yb">"ya");
return 0;
}
result is coming out 0
.
How is this possible?