Say I create a char array, and I assume the char array is empty. If I check the value of the first element in the array (arr[0]), what would be the
char
arr[0]
when initiate array. your are allocating a static memory. and then you will get the values of allocated memory so it's random values
if you want set the whole array to 0 then (According to Hunter McMillen Remark)
char arr[size] = { 0 }
or use memset() function
memset()
memset(arr,0,sizeof_your_arr);