pointers are used for the dynamic memory allocation of variable (refer appendix on memory allocation in programsdeclaring pointer variables the general syntax of declaring pointer variables can be given as below data_type *ptr_nameheredata_type is the data type of the value that the pointer will point to for exampleint *pnumchar *pchfloat *pfnumin each of the above statementsa pointer variable is declared to point to variable of the specified data type although all these pointers (pnumpchand pfnumpoint to different data typesthey will occupy the same amount of space in the memory but how much space they will occupy will depend on the platform where the code is going to run now let us declare an integer pointer variable and start using it in our program code int int *ptrptr &xin the above statementptr is the name of the pointer variable the informs the compiler that ptr is pointer variable and the int specifies that it will store the address of an integer variable an integer pointer variabletherefore'points toan integer variable in the last statementptr is assigned the address of the operator retrieves the lvalue (addressof xand copies that to the contents of the pointer ptr consider the memory cells given in fig figure memory representation nowsince is an integer variableit will be allocated bytes assuming that the compiler assigns it memory locations and the address of (written as &xis equal to that is the starting address of in the memory when we writeptr &xthen ptr we can 'dereferencea pointeri we can refer to the value of the variable to which it points by using the unary operator as in *ptr that is*ptr since is the value of look at the following code which shows the use of pointer variable#include int main(int num*pnumpnum &numprintf("\ enter the number ")scanf("% "&num)printf("\ the number that was entered is % "*pnum)return output enter the number the number that was entered is what will be the value of *(&num)it is equivalent to simply writing num