4 ms·
Here is the way that is correct and obvious to a modern C programmer. Real C libraries use assembly and/or multi-byte methods that violate aliasing rules. si
by burfog 10y ago
Here is the way that is correct and obvious to a modern C programmer. Real C libraries use assembly and/or multi-byte methods that violate aliasing rules.
size_t strlen(const char *restrict const s){
const char *restrict t = s;
while(*t++)
;
return t-s-1;
}