Unsigned Integer
- by viswanathan
I was curious to know what would happen if i assign a negative value to an unsigned variable.
The code will look somewhat like this.
unsigned int nVal = 0;
nVal = -5;
It didnt give me any compiler error. When i ran the nVal was having strange value. Could it be that some 2's complement value gets assigned to nVal.