News for hackers. Stuff that matters.
Re:Why Does Calloc Exist? by Someone on Sunday November 13, 2022 @12:48PM (#33585362)
https://en.cppreference.com/w/cpp/language/operator_arithmet...:

“If the pointer P points to the ith element of an array, then the expressions P + n, n + P, and P - n are pointers of the same type that point to the i+nth, i+nth, and i-nth element of the same array, respectively. The result of pointer addition may also be a one-past-the-end pointer (that is, pointer P such that the expression P - 1 points to the last element of the array). Any other situations (that is, attempts to generate a pointer that isn't pointing at an element of the same array or one past the end) invoke undefined behavior.”

Re:Why Does Calloc Exist? by MaxBarraclough on Sunday November 13, 2022 @02:40PM (#33586554)
I think you may have misread my comment, that wasn't the part I was referring to.