I want to initialise an array in the format that uses commas to separate the elements surrounded in curly braces e.g:
int array[10]={1,2,3,4,5,6,7,8,9,10};
You can use memcpy after the allocation.
memcpy
int originalArray[] ={1,2,3,4,5,6,7,8,9,10}; int *array = new int[10]; memcpy(array, originalArray, 10*sizeof(int) );
I'm not aware of any syntax that lets you do this automagically.
Much later edit:
const int *array = new int[10]{1,2,3,4,5,6,7,8,9,10};