News for hackers. Stuff that matters.
Re:Everything I wish I knew when learning C by Koshkin on Monday November 28, 2022 @12:56PM (#33776931)
Well there’s a little bit more to it. There is a type involved, and then there’s pointer arithmetic.
Re:Everything I wish I knew when learning C by Sohcahtoa82 on Monday November 28, 2022 @01:12PM (#33777194)
Well yes, but those aren't hard.

Pointer arithmetic is merely knowing that any addition/subtraction done to a pointer is multiplied by the size of the type being pointed to. So if you're pointing to a 64-byte struct, then "ptr++;" adds 64 to the pointer.

Re:Everything I wish I knew when learning C by int_19h on Friday December 02, 2022 @02:32PM (#33835619)
Typed pointers interact with aliasing in "interesting" ways.