What is the difference between mblen and strlen?
Is today multi-byte character encoding used in Windows, Linux or Mac OS? Is multi-byte character encoding same as fixed-width character encoding in Windows?
What is the difference between mblen and strlen?
Is today multi-byte character encoding used in Windows, Linux or Mac OS? Is multi-byte character encoding same as fixed-width character encoding in Windows?
strlen takes the length of a const char *, and assumes that one char takes one byte, so it counts the chars until a null terminator ('\0') has been encountered, whereas mblen takes a pointer also of type const char *, but this points to the first byte of the multi byte character.
For more info on what are multi-bye characters, have a look at this question.