4 ms·
Thanks. Now I understand why I found pointers difficult. It's the declaration that confused me.
by HKH2 4y ago
Thanks. Now I understand why I found pointers difficult. It's the declaration that confused me.
- layer8 4y agoYou can read a declaration like `int x` as “`x` is an int”, and hence x is an int pointer.
- lioeters 4y agoWith the asterisks backslash escaped: > ..read a declaration like `int *x` as "`*x` is an int"..
- kccqzy 4y agoI think it would help if beginners learn a language other than C to learn about pointers. My first language was Pascal, and it didn't have a confusing declaration syntax, nor did it have a confusing array decay behavior so it was much much easier to learn. Nowadays of course I don't think about it but those details mattered to beginners.
- HKH2 4y agoYeah. Since trying C, I've learnt a bit of Rust, so referencing and dereferencing seem straightforward without abstracting references using a pointer.