The difference between 1.sizeof and strlen
1) The result type of the sizeof operator is size_t, and its typedef in the header file is the unsigned int type. This type guarantees that the byte size of the largest object established by the implementation can be accommodated
2) sizeof is an operator, strlen is a function
3) sizeof can be used to type parameters, strlen can only be used char * parameter, and must be "to" end, sizeof can also be a function to do parameters.
4) The parameters of the sizeof array do not degenerate, passed to the strlen is degraded to a pointer.
5) Most compilers have calculated sizeof at compile time, which is the length of the type or variable. This is why sizeof (x) can be used to define the number of dimensions of an array
6) The result of the strlen is calculated at run time to calculate the length of the string, not the size of the class-occupied village.
7) After sizeof if the type must be parentheses, if the variable name can be without parentheses, this is because sizeof is an operator instead of a function
8) When a struct-type type or variable is used, sizeof returns the actual size, and when a static array of spaces is used, sizeof returns the dimensions of all arrays, and the sizeof operator cannot return the dimensions of an array or an outer array that is dynamically allocated
9) When an array is passed as a parameter to a function, it is a pointer instead of an array, passing the first address of the array
Some common differences (similar in functionality) in C + +