- sizeof(string) (I may have got the name of the function wrong) returns the length of a single byte rather than the length of the entire string. Who the hell thought that would be a good idea?
Hey, just because you don't know the language doesn't mean it's necessarily wrong. Documentation for sizeof would have told you that it's for telling you the size in bytes of datatypes on a particular system. It's often paired with malloc to allocate memory for something.
The C specification is remarkably lax on the size of its numeric datatypes, too. To the point where eventually a bunch of bit-specific sizes were introduced because the basic versions weren't. example: uint32 is a 32-bit unsigned integer, where as uint is an unsigned integer that's 16-bits or larger depending on the platform.
For that matter, even pointer size changes depending on systems. For instance, it's 4 bytes for 32-bit Intel systems and 8 bytes for 64-bit Intel systems.