mixed type / buffer over flow
I've tried messing with the code below. I'm not sure why it's returning -7. I have a vague idea and that is that there is a overflow since the range of a char is between -127 and 127 but i don't get how c = -7 is calculated.
when i change j=1 i get
c = 35
when c is 4 i get -114 (this is when the minus numbers start to happen). I just haven't made sense of it.
Code:
int main()
{
int i = 10, j = 7;
double q = 3.56;
char c;
c = q * i * j;
printf("c = %d\n", c);
return 0;
}