Y
Hacker News
new
|
ask
|
show
|
jobs
by
1718627440
307 days ago
> You can't have a reference (aka pointer) pointing to a variable.
What?
int a; int * p = &a; ?
1 comments
ramchip
294 days ago
That's a pointer to an integer.
link
1718627440
292 days ago
Yes. You claimed you can't have pointers to a variable. I showed how to have a pointer to a variable of type integer.
link
ramchip
290 days ago
If you dereference it you get back an integer, not a variable. A variable is a name that identifies a value; the pointer points to the value, not to the name.
link