Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +917541905230, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec

Friday, December 4, 2020

What is memory address in C

A memory address is a location of a variable in the memory. Much like a street address uniquely identifies a building, a memory address uniquely

Memory address in C | welcome2protec.com

What is memory location or Memory address?

A memory address is a location, in the memory of a computer, of a particular "word" of data. Much like a street address uniquely identifies a building, a memory address uniquely identifies a memory value.

Let’s start with the memory, every computer has some memory and every program needs some memory to run. The smallest unit of memory is a byte, which is equal to 8 bits. In a typical modern day computer or laptop you have hundreds or thousands of such bytes and each of these bytes have a unique address in hexadecimal format associated with it.

Memory addresses start from zero and increase up to the size of memory. For example, on an 8-bit computer with 4K of memory, the addresses would run from zero to 4095. (4 kibibytes is 2^12 bytes. Yes, kibibytes is the correct SI unit for memory. kilobytes is used for non-volatile storage.) This arrangement was typical of early eight-bit CPUs like the 8048 or 8051 CPUs which have a larger address bus than a data bus. Similarly A 16 bit processor, where 16 bits can only access 2^16 bytes, or 65,536 bytes,

Typically memory addresses are limited to the size of the physical address bus of the CPU. This is where you hear 32 bit or 64 bit CPU. A 32 bit CPU can address about 4.2 billion bytes of data, while, in theory, a 64 bit CPU can address up to 18 quintillion bytes of data.


What is address of a variable?

In C language, every variable gets a memory location (Address of variable) somewhere in the RAM when it is declared, which help us to access the value of that variable. This memory location has a unique address in hexadecimal format something like 0xbffd8b3c. Simply you can say, A memory location where data is stored is called address of variables.

Address of variable | welcome2protec.com
Address or memory location of variables | welcome2protec.com

Let’s consider a scenario: In a computer network every computer has a unique IP address if you need data from that computer we need to access that computer by using IP address. The same way if we need to access the value of variable ‘x’ we need to access memory location of that variable by using address of (&) Operator with format specifier either %p, %x or %u.













Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +966532621401, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec

Help others by sharing this page.

Ahmad Irshad

Author & Editor

I love blogging, teaching, learning computer science and sharing it to others. I've written and develped this site so that students may learn computer science related tutorials eaisly. MCA / MCITP

0 Comments:

Post a Comment

Please don't enter any spam link in the comment box.


Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +966532621401, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec
Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec
Contact Us