Prolixity is an indication of free time, not knowledge. Especially when about half of those come from circular debates from ever changing positions about whether scrambled eggs are better for you than poached eggs or something equally as pointless. That said:
Originally Posted by shrink_tubing
I'd be interested to know why the code has undefined behaviour
Do yourself a favour and heed this:
char* ptr = new char; // here be square brackets
delete ptr; // here be no square brackets
You don't need to use new here.