C Program to Access Address of Variable using Pointer


Program :

Output:

Explanation :

Variable ‘i’ is declared of type integer in the program , now suppose the integer variable can have value 3 stored inside it and it has address 65524.
Value of the Variable at Particular Memory location Pointer
Suppose we want to access the address of the variable i then we can use ampersand operator to find the address of the variable.

and whenever we use ampersand and value at operator together then we will get actual value of the variable.

Values of Variable and Address

Variable ExpressionMeaning of the VariableValue
Address of i65524
iValue of variable i3
Value of variable i3