c++ - Trouble with initializing multidimensional array -


we initialize 2d array this:

int a[2][3] = {{2,3,4},{5,6,7}}; 

i need initialize 2d array this:

int a[2][3]; a[0] = {2,3,4}; a[1] = {5,6,7}; 

i.e. want initialize array array. why method fail? should do? or can define a array of array?

the idea of array keep data in memory contiguous, not achieved approach using, recommend using c style memory management raw memory low level fast, thigh , possibly dangerous solution, or change different data container vector (or others) can add elements similar want , memory still contagious simple array. although depending on size of problem might overkill use vector.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -