I have a little problem working on with char in C++ as I have tried comparing 2 texts in an if and there is what I've got:
Input:
if ( "bac" < "ab" ) cout<<"1";
if ( "ab" > "bac" ) cout<<"1";
Output :
11
I don't really understand why it is printing "11", but moreover if I erase the first 'if' it will no longer print anything on the screen. Could you please explain why it has such a behaviour on these IFs?
Aucun commentaire:
Enregistrer un commentaire