Memory representation of int in c

Memory representation of unsigned int:
Total size of unsigned int: 16 bit
Those eight bits are use as:
Data bit: 16




Example:
(1)Memory representation of:

unsigned int a=7;          (In Turbo c compiler)
unsigned short int a=7 (Both turbo c and Linux gcc compiler)

Binary equivalent of data 7 in 16 bit:  00000000 00000111
Data bit: 00000000 00000111
First eight bit of data bit from right side i.e. 00000111 will store in the leftmost byte from right to left side and rest eight bit of data bit i.e. 00000000 will store in rightmost byte from right to left side as shown in the following figure:   




Introduction
List of data types
Primitive data types in c
Modifiers of data types in c
List of modifiers in c
Default modifiers of data types in c
Default data of modifiers in c
Rules of using modifiers in c
Possibles modifiers of given data types in c
Size modifier in c
Size of data types in c
Sign modifier in c
Range of data types in c
Easy way to remember limit of data types in c
Const modifiers in c
Pointers modifier in c
Function modifier in c
Interrupt modifier in c
Volatile modifier in c
Fundamental data types in c
Memory representation of char in c
Memory representation of signed char in c
Memory representation of int in c
Memory representation of signed int in c
Memory representation of double in c
Post a Comment