Can somebody tell me why the if condition is false?
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a;
unsigned int ua;
a = -1;
ua = a;
cout << "ua: " << ua << endl;
if (ua != -1)
cout << "Is unsigned" << endl;
else
cout << "Is signed" << endl;
return 0;
}
I mean, here ua == int_max_value, it's NOT -1, but when I run this, the output is
Is signed