Y
Hacker News
new
|
ask
|
show
|
jobs
by
kevincox
1885 days ago
What do you mean by assigning to a pointer? You can only assign a pointer value to a pointer variable and you need to get that pointer from & IIUC.
1 comments
masklinn
1885 days ago
> What do you mean by assigning to a pointer?
*x = y
link
kevincox
1885 days ago
I don't think that does because IIUC you are copying the bits of y to x. So I guess semantically y has escaped but you aren't doing a new heap allocation, you are reusing the memory of x.
link