News for hackers. Stuff that matters.

chelahmy

Re:Let’s Stop Bashing C on Friday December 02, 2016 @04:06PM (#13092298)
Will the following help with the depth, or any depth?

  int *a, **b, **c, **d;

  d = c = b = &a;
Re:Let’s Stop Bashing C on Friday December 02, 2016 @03:47PM (#13092150)
I read it as integer arithmetic. It is semantically different from pointer arithmetic.
Re:Let’s Stop Bashing C on Friday December 02, 2016 @01:58PM (#13091267)
Even if it is done correctly with a comma after the 'bar' instead of a semicolon, I think it is a bad practice to separate statements with commas. But if you think in semicolon all of the time and skip some brackets then you will mostly get similar buggy code as the above.
Re:Let’s Stop Bashing C on Friday December 02, 2016 @12:54PM (#13090734)
> some other structure hanging onto the original reference.

Let's unleash the superpower of C. You should've been using pointers to a pointer so that it is always a single reference to a memory block.

You can't really be programming in C if you're not thinking in pointers.

One more thing; The article should have mentioned "pointer increment" which has nothing to do with "+= 1".