Short answer: Because C and C++ are different languages with different rules.
Long answer: In both cases the reason is that the array is too small for the string literal. The literal consists of the five visible characters, with a zero terminator on the end, so the total size is 6.
In C, you're allowed to initialise an array with a string that's too long; extra characters are simply ignored:
C99 6.7.8/14: An array of character type may be initialized by a character string literal, optionally enclosed in braces. Successive characters of the character string literal (including the terminating null character if there is room or if the array is of unknown size) initialize the elements of the array.
The compiler helpfully warns that the string is too large, since it almost certainly indicates an error; but it can't reject the code unless you tell it to treat warnings as errors.
In C++, the initialiser isn't allowed to be larger than the array:
C++11 8.5.2/2: There shall not be more initializers than there are array elements.
so, for that language, the compiler should give an error.
In both languages, when you want a character array to be the right size for a string literal initialiser, you can leave the size out and the compiler will do the right thing.
char a[] = "hello"; // size deduced to be 6