Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Populating a 2-dimensional array
#1
Hi,

I know this is a very simple question, but I am confused on how to populate a 2-dimensional array. I have read the help, but it is not sinking in Sad

Say I have

Code:
Copy      Help
ARRAY(int) 2d-array
2d-array.create(6 4)

Which in my mind is like the following. How would I add a value to 2d-array [5,0]?

X X X X X X
X X X X X X
X X X X X X
X X X X X X

Thanks kindly
Matt
#2
QM does not have easier ways to populate int arrays, like in C++ int a[]={value, value,...};
Need to set each value like this:
Macro Macro1998
Code:
Copy      Help
ARRAY(int) a
a.create(6 4) ;;create array, all values 0
a[5 0]=3 ;;set a value

out a[5 0]
#3
Perfect. Thanks kindly Gintaras.


Forum Jump:


Users browsing this thread: 1 Guest(s)