
-----------------------------------
sevendust
Tue Nov 30, 2004 2:08 pm

can anyone help me with two dimensional arrays?
-----------------------------------
heres the question i cant figur out... 
write a program that creates a 4x4 array called BINARY containing integers. load the array with a 1 when the row  and colummn are the same and a 0 when the row and column are different.i.e binary(1, 1)=1, binary (2,2)=1, etc, all other elements are 0....thanks to the person who can email me the answer at richardo1988@hotmail.com or post it here, thanks very much

-----------------------------------
Martin
Tue Nov 30, 2004 2:38 pm


-----------------------------------
Search the forums, there are a million array tutorials.

http://www.compsci.ca/v2/search.php

-----------------------------------
Cervantes
Tue Nov 30, 2004 6:02 pm


-----------------------------------
Arrays and for loops are built to work together.  Use those for loops.  You've got a 2-demensional array, so use 2 for loops.  If the counters of the for loops are the same, make the array = 1, otherwise, make the array = 0.

-----------------------------------
Mr. Glib
Tue Nov 30, 2004 9:51 pm


-----------------------------------
sevendust, don't forget to use a check to see if the row and col numbers are equal to one another.

-----------------------------------
Andy
Wed Dec 01, 2004 4:01 pm


-----------------------------------
err wtf u talkin about.. wth does the row and col have to equal each other

-----------------------------------
SuperGenius
Wed Dec 01, 2004 5:43 pm


-----------------------------------
I think it's just a peculiar assignment.
