I don't know if it's an error from C++ or not.
Try this two codes: I tried to compare two string "a" and "adnan", in two codes, it giving me two different outputs, where the second one is correct.
#include<bits/stdc++.h>
using namespace std;
int main()
{
// cout<<("a">"adnan")<<endl;
cout<<("a"> "adnan" ? "a": "adnan")<<endl;
}
/* The output is:
a
which is incorrect.
*/
and
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<("a">"adnan")<<endl;
cout<<("a"> "adnan" ? "a": "adnan")<<endl;
}
/* the output is:
0
adnan
*/
which is correct.
I tried from different compilers I've tested it from codechef's compiler also: c++ 14, from ideone: C++, C++ 14
And found the same error. let me know reason please.