hi all
Code:
#include<stdio.h>
#include<stdlib.h>
main()
{
char x;
char f;
int z;
x='f';
f='d';
z=x+f;
printf("\n %d , %d\n",x,f);
printf("%d\n",z);
exit(EXIT_SUCCESS);
}
as my topic says i am asking about integral promotions
when integral promotion applied shouldn'y the value be an int in case it cane hold it and unsigned int in case int can not hold it
so
look at this code
Code:
#include<stdio.h>
#include<stdlib.h>
main()
{
char x;
char f;
char z;
x='f';
f='d';
z=x+f;
printf("\n %d , %d\n",x,f);
printf("%d\n",z);
exit(EXIT_SUCCESS);
}
it gives me the output -54 !!!!!!!! how this could be ?
shouldn'y it gives me error or somtehing that it cannot assgine value to this kind or variables ???
or i am getting the hall thing wrong ?
so my question is
how and where integral pormotions occures ?
thanks in advance