You are on page 1of 1

Some information about pointer:

1.when you want to declare any pointer in your programme,you should first type the data type and
then press * symbol nd then variable symbol...
such as:
char *p.....this means p is a pointer to a character data type....( * means "a pointer to a data type")...
2.after the declaration,wihen you use your pointer variable without *...that indicates the
address.....example: int * p;
p=&x means, p is a pointer which saves the address of a variable x....address means ,in which place
the x variable's value is saved by processor...if x is saved in 234560th position,then p's value is
234560.........
3. When you use the pointer variable with * symbol after declaration,it means the processor will go to
that address which is saved in the pointer variable's as value and work for that address...let me clear
it by an example.... int *p;//declaration a pointer
p=&x//save the x variable's address,say x is saved in 234th position and p variable's position is
121..then p's value is 234 and it's saved in 121 no position..
*p=5 // processor 1st go to the position of p...i mean 1st go to the 121th position then processor see
that the value 234 is saved in this position....then processor go to 234 no. position and that position
processor will save 5....but 234th position's owner is x..so the value of x is also changed for it......
//the address will be chosen by the processor....smile emoticon

You might also like