General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Anony Mousse
Low Level
comments
Comments by "Anony Mousse" (@anon_y_mousse) on "do you know how "return" works under the hood? (are you SURE?)" video.
This is really only valid for a tiny subset of cases, and leaves off an explanation of different calling conventions and architectures which have different return patterns. On top of that oversimplification your implementation of strlen() is actually wrong. Forget best practices, at the very least return a correct result and use the correct function signature: size_t strlen ( const char *s ) { const char *t = s; while ( *t ) t++; return t - s; }
2