new certainly cannot do that, and since you want a dynamically allocated array, you should be using new[] instead of new.

But wait. The standard containers have just want you wanted, and in this...