1.sizeof finds the size of the space occupied by the data type (not affected by the content stored in it), while strlen finds the length of the string.
2. The parameter of sizeof can be a variable or a data type, and the parameter of strlen can only be a string ending with "\0".
3. The compiler calculates the size of sizeof during compilation, but strlen can only calculate the string length while the program is running.
4. In the sub-function, ziseof will treat the character array passed in from the main function as a pointer.
5. For character arrays, '\0' also occupies a node in sizeof calculation, but does not count in strlen, because strlen is used to calculate the length of the string, and the end mark is not counted.
Reference blog: https://blog.csdn.net/shimadear/article/details/83306539