2D Arrays

Given the array:      int array [x][y] = {y terms};

How do you you give rows other than the first values?
JeloAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nietodConnect With a Mentor Commented:
A 2D array is an 1D array of 1D arrays, so you initialize it using an array of 1D arrays, like

int Array[3][4] = {{1,2,3}, {4,5,6},{7,8,9}.{10,11,12}};
0
 
viktornetCommented:
just a small correction which is a typo...

}.{

should be
},{
0
 
nietodCommented:
You must have better eyes and/or a better font than me.  Thanks.  
0
 
viktornetCommented:
no problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.