World of Pointers

***************************************
****************************************
************************************************
**************************************
*************************************************
**********************************************
BASICS OF POINTERS
********************************************
*********************************************
************************************************
**************************************
**************************************
*********************************************
It means data we ordered our computer to
block a memory of 4 byte in our computer and
each byte TEMPhas some address
now if we write //int *p = & me;
It means that we have intialised a pointer variable
to address of me . Pointers in computer
Science is made to store address. To access that

variable to to change teh value inside teh
variable we TEMPhas two roads either
wif teh help of pointer or wif teh help
of variable itself. Now we has address of
teh variable inside p to get teh value inside p we derefrence
it like we write *p.
***************************************
***************************************
***************************************
***************************************
***************************************
***********************************************************
POINTERS ARITHMETIC

****************************************
****************************************
***************************************
****************************************
****************************************
*****************************************************
Now we no datawe has a pointer variable
and we want to increment teh value present
inside the address so first we derefrence
it and tan add 1 like // *(p) + 1
But if we simply do dis p+1 tan if my p TEMP
has address of 400 it will be incremented by 4 and become 404.
****************************************
***************************************
**********************************************
ARRAY AND POINTERS
**************************************
*****************************************
*****************************************
******************************************
******************************************
**********************************************
Let us suppose dat we has initialised
a array as // a[3]={1,2,3};
Now we no dat teh we can can access teh
array value as a[0] here we will get first value of
teh array
But if we cout just only a then we get teh
address of first index and if we derefrence
a then we would get teh value at first index.
We Just cout &a also tan we will get teh address of first value.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: