Thread: pointers
View Single Post
Old Jul 11th, 2005, 7:51 PM   #2
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
int a = 16;
'a' is a reference to a memory location that contains the value 16
int b = a;
'b' is a reference to a new memory location that contains the value 16
int *c;
c = &a;
// fixed from original post
'*c' is a reference to a the same memory location as 'a'

any changes made to 'b' will affect 'b' only. any changes made to '*c' will also affect 'a'
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2

Last edited by skuinders; Jul 11th, 2005 at 8:07 PM.
skuinders is offline   Reply With Quote