• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

2D Arrays

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

How do you you give rows other than the first values?
0
Jelo
Asked:
Jelo
  • 2
  • 2
1 Solution
 
nietodCommented:
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now