You can't put a large value in small cup. Well, OK, you can, but you'll lose some. You'll get, as we say, spillage. the compiler tries to help prevent this if it can tell from your code that something's not going to fit in container(variable) you are using.
For Example,
int x= 24;
byte b= x;
// Won't work!!
now range of byte is -128
to 127
. Now, my question is why doesn't this work? After all, the value of x
is 24
, and 24
is definitely small enough to fit into byte (may be a very novice level question, but i am really confused about this concept).