Re:Massacring C Pointers
by LukeShu on Tuesday June 26, 2018 @01:58AM
(#17398223)
Besides stylistic (dang, that code is hard to read), efficiency (it scans through s twice), and safety (it will do bad things if the combined length is > 100) concerns, it's also just plain wrong:
It returns a pointer to memory on the stack; but the stack will shrink when the function returns, and that piece of memory will get re-used. Which is consistent with the article's later claim that "I don’t think he understands the call stack."
It returns a pointer to memory on the stack; but the stack will shrink when the function returns, and that piece of memory will get re-used. Which is consistent with the article's later claim that "I don’t think he understands the call stack."