3 ms·
The notion was that strings would be consumed fully, thus the starting pointer could be used for iteration, and null char is a natural end condition. Here it is
by zoomablemind 7y ago
The notion was that strings would be consumed fully, thus the starting pointer could be used for iteration, and null char is a natural end condition. Here it is, saving an int and cycles for tracking length.
It's just coding in such way appears to be too low-level. Pointer in programmer's hand became akin to neuro-surgeon's scalpel... casually performing surgery often on 'self' and with shaky hands.
Sure, take this length to limit potential damage.