Today I was trying this code in C++:
string s1 = "a";
string s2 = "bcdef";
cout << s1.size() << " " << s2.size() << endl; //output 1 5
cout << (s1.size() — s2.size()) << endl; // output 4294967292
if I do,
cout << (int)(s1.size() — s2.size()) << endl; // then output -4.
Is this due to reason that s1.size() returns unsigned int.
Can you please exactly tell me, what's the funda for this?