Given a string , say ,
char *str = \"Hello,StackOverflow!\" char newStr[30]; int l = strlen(str); for(int i =0 ; i
By chance, most of the time the uninitialized bytes in newStr happen to be 0 in your particular case.
newStr
0