4. How is the data stored #

Created Thursday 17 October 2019

How are float stored? For the decimal equivalent, we store the mantissa and the corresponding exponent. Typecasting:

e.g1 int x = 19920; char p = x; // the compiler will just copy the last byte of the integer as the value of the char. e.g2 char a = ā€˜cā€™; int x = a; // here the byte for the char is copied as the least significant byte of the integer. The remaining 3 bytes in the left are kept zero.