Is the third line in the following code well-defined?
char* result = new char[0];
printf("%d\n", strlen(result));
printf("%s\n", result);
delete[] result;
When I run the code, I get the expected output (a length of 0 followed by a two newlines printed). However, I'm not confident about whether this is a well-defined behavior or I just got lucky.
Is the call on the third-line well-defined?