|
Shadow0 posted:Also, the & and * are part of the variable type and belong next to that, not the variable name, which it has nothing to do with. I thought this for decades, I mean it's obvious? But then I read Stroustrup and learned it is wrong. A pointer is a special virtual thing. To turn it into an actual thing you dereference it with a star, so *(a pointer) = a thing, therefore you define a thing named (*name) then name is a pointer, cos *name is the thing. And cos if you write a list like: code:
also: code:
There is a dedicated circle of hell for people who would use any of this in any actual code. my mind was so blown by this obvious reasoning I forgot to look up why the '&' does the same. I think the answer for that is a because-it-does-you-wanna-start-something shrug. OzyMandrill fucked around with this message at 15:43 on Oct 30, 2022 |
# ¿ Oct 30, 2022 15:40 |
|
|
# ¿ May 16, 2024 15:40 |