Kamis, 08 Desember 2016

How to access the address of a variable in C programming

The actual location of a variable in memory is system dependent. A programmer cannot know the address of a variable immediately. We can retrieve the address of a variable by using the address of (&) operator. Let’s look at the following example: 1 2 3 int a = 10; int *p; p = &a; In the above example, let the variable a is stored at memory address 5000. This can be retrieved by using the address of operator as &a. So the value stored in variable p is 5000 which is the memory address of variable a. So, both the

The post How to access the address of a variable in C programming appeared first on Coding Security.


How to access the address of a variable in C programming
read more

Tidak ada komentar:

Posting Komentar