We can access computer's memory address using pointer.
What is memory address? Let's see that first.
A variable is given a memory in the compiler. We call it memory address.
Eg:
int a=45;
a is the variable. 45 is the value of the variable. 1004 is the memory address. The memory address contains the hexa decimal numbers.
Address of variable:
The memory address of a variable depends on the computer we are using.
Address operator(&) is used to find the memory address of a variable in C language.
syntax:
&variable name
Eg:
a=&b;
printf(“variable address:%d”,&b);
Declaring And Initializing Pointer:
To declare a pointer variable, put '*' before the variable.
Syntax:
datatype *variable;
Eg:
int *b;
b is an integer type pointer variable.