Hi, I am learning C as a hobby. Was looking at a textbook that I got at the fair. They talking about basic types etc and have the following code:
char ch;
int i;
i = 321;
ch = i;
printf("ch=%d\n",ch);
so what I did was to compile it to see what ch would be.
I get ch=65
So this is what i dont get. if i=321, then ch=i, why wont ch=321?
While compiling the code above I thought I would change the i value.
I tried i= 101 got ch=101; i=128 got ch=-128.
Is it something I am doing wrong when compiling or am I missing this whole char = 1 byte etc.
Thank you in advance.