News for hackers. Stuff that matters.
Re:Everything I wish I knew when learning C by HKH2 on Monday November 28, 2022 @09:41AM (#33774139)
Thanks. Now I understand why I found pointers difficult. It's the declaration that confused me.
Re:Everything I wish I knew when learning C by layer8 on Monday November 28, 2022 @09:51AM (#33774289)
You can read a declaration like `int x` as “`x` is an int”, and hence x is an int pointer.
Re:Everything I wish I knew when learning C by lioeters on Monday November 28, 2022 @03:32PM (#33779162)
With the asterisks backslash escaped:

> ..read a declaration like `int *x` as "`*x` is an int"..

Re:Everything I wish I knew when learning C by kccqzy on Monday November 28, 2022 @06:02PM (#33781132)
I 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.
Re:Everything I wish I knew when learning C by HKH2 on Monday November 28, 2022 @06:54PM (#33781653)
Yeah. Since trying C, I've learnt a bit of Rust, so referencing and dereferencing seem straightforward without abstracting references using a pointer.