The C libraries use the convention that a string is an array of characters, with a variable number of characters used in the array. A NUL character (which is a binary 0 value, expressed as a character by '\0'), is placed after the last character used, to mark the end of the string. This means that the character array must be large enough to hold the largest number of characters you want to put in it, plus one more for the NUL character. The NUL character is also referred to as a terminator, and this type of string is sometimes called a NUL-terminated string.
The strlen() function starts at the beginning of the string, and counts characters until it reaches a NUL, then returns the character count. strlen() has no way of knowing how big the character array is, so if it doesn't find a NUL in the array, it keeps going off the end of the array until it runs into a NUL.
The error in your program is that your string (dadd) has no NUL terminator. strlen() is going beyond the end of your array. Since adding snprintf() changes the variables in memory, it gets a different result.
Here's how you can change your program to make it work correctly: char dadd[6]={20,31,11,2,36,0};
I don't know what you are using the array for, but it does not look like ASCII characters. It looks like an array of integers. The problem with trying to use string functions on an array of integers is that you can't put a zero in the middle of the string. If you're sure that you will never have a zero as a valid value, then it will work fine.
thanks for mfm9's reply
The original code is that I used to make a control of sound module by one WIRE serial control,which trans a serial of address numbers between 0 to 255.
For failed to find a reliable method to count the length of a integer array, I use the ASCII code of a string to replace it.