News for hackers. Stuff that matters.
Re:The Most Expensive One-byte Mistake (2011) by mzs on Friday April 11, 2014 @03:42PM (#7575118)
Except that's not how K&R would have done it. It would have been pascal style: one byte of length directly followed by the string itself in memory. The pointer would be the address of the length byte. Now it's hard to create strstr without copying so they wouldn't. Instead you would have a new API where every call would have offsets to the beginning, likely it would be one based too. Anyway C does it the way it does cause PDP set the zero condition flag on move.

There are no comments on this comment yet.