vendredi 5 juin 2015

Why is the size of a heap-allocated array required with initializer-list initialization?

While I can write,

int n[] {1, 2, 3};

I cannot write

int *m = new int[] {1, 2, 3};

which should be

int *m = new int[3] {1, 2, 3};

What is the reason for this?

Aucun commentaire:

Enregistrer un commentaire