Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C

Looking at pointer declarations

5.00/5 (2 votes)
15 Jan 2010CPOL 6.5K  
It is very simple :laugh: and fun ..just divide the line before and after * , likeconst int * pconst int (before *) represent [constant integer]and *p represent a pointer add both u get a pointer pointing to a constant integer , it means u can't change value but pointer can...
It is very simple :laugh: and fun ..

just divide the line before and after * , like

const int * p

const int (before *) represent [constant integer]
and *p represent a pointer

add both u get a pointer pointing to a constant integer , it means u can't change value but pointer can point to different address .

simiarly

int * const p

same way ...

go to here for best explanation understand pointer

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)