Conside the following code:
int main()
{
signed char a = 10;
a += a; // Line 5
a = a + a;
return 0;
}
I am getting this warning at Line 5:
d:\codes\operator cast\operator cast\test.cpp(5) : warning C4244: '+=' : conversion from 'int' to 'signed char', possible loss of data
Does this mean that += operator makes an implicit cast of the right hand operator to int
?
P.S: I am using Visual studio 2005
Edit: This issue occurs only when the warning level is set to 4