D
dam_fool_2003
For int data type the default range starts from signed to unsigned. If
we don't want negative value we can force an unsigned value. The same
goes for long also.
But I don't understand why we have signed char which is -256. Does it
means that we can assign the same ASCII value to both signed and
unsigned. That means the ASCII value can be represented with a type of
signed char and also unsigned char?
For example
int main(void)
{
signed char a= 'a';
unsigned char b = 'b';
printf("%i %c",a,b);
return 0;
}
The above code does not warn about the assignment. I went through the
faq ,
Section 8 but I don't find the answer. Can any one give any pointer
regarding
the above subject?
we don't want negative value we can force an unsigned value. The same
goes for long also.
But I don't understand why we have signed char which is -256. Does it
means that we can assign the same ASCII value to both signed and
unsigned. That means the ASCII value can be represented with a type of
signed char and also unsigned char?
For example
int main(void)
{
signed char a= 'a';
unsigned char b = 'b';
printf("%i %c",a,b);
return 0;
}
The above code does not warn about the assignment. I went through the
faq ,
Section 8 but I don't find the answer. Can any one give any pointer
regarding
the above subject?