## INDEX

### What is the ram of a computer?

What is the ram memory: Memory cell in computer

Entire RAM has divided in numbers of equal parts, which are
known as memory cells. Following diagram represents the 256
MB RAM.

Each cell can store one-byte data. Data are stored in the
binary number system. That is a character data reserves one
memory cell while floating data reserves four memory cells.

Each memory cell has unique address. Address is always in
whole number and must be in increasing order. We will discuss
how a characters, integers etc. data are in stored in the
data type chapter. Just for now assume

int a = 4;

Here variables a stores in the memory in the flowing way:

If you know memory address of first cell is 0x5000 then
what would be the memory address of next memory cell?

It will 5001 since integer data always stores at
continuous memory location and as we know memory address
always in increasing order.

C tutorial home.

dinhpq said...

Thanks.

Anonymous said...

here integer takes 2-bytes length, so the next address 5002.

Unknown said...

edit it immediately!

Unknown said...

Sorry it's absolutely correct i think!
If we take array of int like this..

int[2] a;

memory allocated for 2 sequential variables.

In C, int is 2 bytes.

completely 4 cells are allocated!
2 cells - 1 variable
2 cells - another 2nd variable.

1st variable: 1st cell address is 100,
2nd cell address is 101.
then
2nd variable 1st cell address is 102.
2nd cell address is 103.

prashant aggarwal said...

nopes..
here actually storage of int started form 0x4999
0x4999 00000000
0x5000 00000100

prashant aggarwal said...

nopes..
here actually storage of int started form 0x4999
0x4999 00000000
0x5000 00000100

matheen smart vip said...
This comment has been removed by the author.
matheen smart vip said...

compile this:

#include

int main()
{
int ptr=5;
printf("%X\n%X",ptr,&ptr+1);
ptr=ptr+1;
printf("\n%X\n%X",ptr,&ptr+2);
ptr=ptr+1;
printf("\n%X\n%X",ptr,&ptr+3);

return 0;
}

Nayan Mani Baruah said...

Hello friends its not clear to me why 00000100 is not stored in the second byte, like normally we do in binary number system 00000000 00000100 ,is there any kind of big endian or little endian concept out here....

Anonymous said...

what if the int hold 4 bytes

Unknown said...

My understanding is like this.
int a = 4;
means a = 0X 0004; => 00000000,00000100;
Since little endian.....Lower Byte in Lower Address and Higher Byte in Higher Address.
So if lower byte 00000100 address is 5000......higher byte 00000000 address is 5001....
is it ok?

..BURRA..

7seven said...

Great blog thanks for sharing seveninfotech is the best cctv camera wholesaler in chennai. We provide high quality cctv brands like Hikvision, Dahua, Hifocus, Essl, ZKT ECO etc. For order call - +91 95000 96878.

Digital Pingu said...

We focus on providing the best digital marketing solutions over tactical work progress to get productive results over strategic marketing techniques to our clients, who want to grow their business wider and more visible to meet market attention on the go. Specialized in growth hacking to strive for client’s requirements by our unique work progress.