What is a pointer variable?

  A pointer variable is a variable that may contain the address of another variable or any valid address in the memory.

Showing Answers 1 - 1 of 1 Answers

R.S.Jayasathyanarayanan

  • Dec 27th, 2006
 

pointervariable  is a  variable that can hold the address of variable and it is act as a array and  adavantage of pointer varialble is to change the  values in the prgroam in anywhere for  example program

void main()

{

int a=10,b=20 ;

printf("print the values before swap %d %d,a,b);

swap(&a,&b); //here address of the variable is passing

printf("print the values after swap %d %d,a,b);

getch();

}

swap(int *p,int *s) //pointer variable get the address of the variables

{

int temp;

temp=*p;

*p=*s;// here we r chaging tha values a=10 by 20

*s=temp; //here b=20  to   10

return ;

}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions