Click here to Skip to main content
15,881,938 members
Articles / Programming Languages / C
Alternative
Tip/Trick

Looking at pointer declarations

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
15 Jan 2010CPOL 6K   2   1
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)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralReason for my vote of 5 nice Pin
Global Analyser20-Jun-11 4:32
Global Analyser20-Jun-11 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.