I am asked to say whether the following piece of code triggers any error or warning:
char string[5] = "hello";
I have tested it on my computer and it worked fine (no error/warning and printf gave the expected value ("hello") and strlen gave the expected value (5)). However, I would be tempted to say that this yields some kind of undefined behaviour. I suppose this is considered a bad practice anyway, but can it cause an error since we are not explicitly allowing a byte for the null character?