I spent a long time puzzling over a crashing program and realised that I'd put
ptr = new char(10);
where I should have had
ptr = new char[10];
But I noticed that the wrong version didn't make the compiler issue a warning. So new char(10) must have a meaning? Is it a construction you'd ever use purposely?
That's placement new - in this case it would be equal to
ptr = (char*)10;
so that returns a char* with the value 10. It assumes you already own that memory.
If you'd do that with a class the constructor of that class would also be called.
The only reason I can think of right now why one would use this is if you use a memory pool. Normally that's not the case, so you can probably just ignore the existence of that for now.