
We have used the integer and character variables many times in our program. Here we will see how they are stored in the memory.
In C the character values are also stored as integers. In the following code, we shall put 270 into a character type data. So the binary equivalent of 270 is 100001110, but takes only first 8-bits from right. So the result will be (00001110), that is 14. Then stores the value into variable a. It also gives warning for overflow.
基于jsp+javabean+mysql三层结构的动态购物网站。网站用户接口(即界面)由jsp完成,数据和逻辑处理由beans完成,数据储存由mysql完成。因为beans独立负责处理整个网站的绝大部分数据,所以整个网站的负载量和速度都将大大提高。而且jsp的特性是一次运行,永远储留内存(包括bean在内),所以基于这种语言和结构开发的购物系统的优势是其它语言没法比尔的。更重要的是,jsp+bea
In the next variable y, we are trying to store negative number say -130. The negative number will be stored as 2’s complemented method. So the binary of 130 is (10000010). The 2’s complemented value is 01111101 + 1 = 01111110. Here also the right most 8-bits are taken. So the result will be (01111110) = 126
Example
#includeint main() { char x = 270; char y = -130; printf("The value of x is: %d ", x); printf("The value of y is: %d", y); }
输出
The value of x is: 14 The value of y is: 126










