I have a very simple C++ code here:
char *s = new char[100];
strcpy(s, \"HELLO\");
delete [] s;
int n = strlen(s);
If I run this code from
Dereferencing a pointer after delete is undefined behavior - anything can happen, including but not limited to:
exact results will depend on multiple factors most of which are out of your control. You'll be much better off not triggering undefined behavior in the first place.